[TASK] Extend blog_example with relations 62/58362/7
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Fri, 24 Aug 2018 16:55:29 +0000 (18:55 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 21 Sep 2018 07:31:26 +0000 (09:31 +0200)
* 1:1 inline relation csv (Post->additonalName)
* 1:1 inline relation foreign_field (Post->additonalInfo)
* 1:n inline relation csv (Post->additionalComments)
* n:1 group relation (Post->secondAuthor)

It also makes Person model translatable.

Resolves: #85974
Releases: master, 8.7
Change-Id: I75a8e6c070e9a6bdfba0772b102a13bc94f7556f
Reviewed-on: https://review.typo3.org/58362
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Blog.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Info.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Post.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_blog.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_comment.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_info.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_person.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_post.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_tag.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Resources/Private/Language/locallang_db.xml
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_tables.sql

index 69c02e9..d785221 100644 (file)
@@ -77,6 +77,7 @@ class Blog extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     public function __construct()
     {
         $this->posts = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+        $this->categories = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
     }
 
     /**
diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Info.php b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Info.php
new file mode 100644 (file)
index 0000000..a9406ec
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+namespace ExtbaseTeam\BlogExample\Domain\Model;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * A post additional info (1:1 inline relation to post)
+ */
+class Info extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
+{
+
+    /**
+     * @var string
+     */
+    protected $name = '';
+
+    /**
+     * Sets the name
+     *
+     * @param string $name
+     */
+    public function setName($name)
+    {
+        $this->content = $name;
+    }
+
+    /**
+     * Getter for name
+     *
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Returns this info as a formatted string
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return $this->name;
+    }
+}
index 1e4f8d4..800a7a8 100644 (file)
@@ -43,6 +43,11 @@ class Post extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     /**
      * @var \ExtbaseTeam\BlogExample\Domain\Model\Person
      */
+    protected $secondAuthor;
+
+    /**
+     * @var \ExtbaseTeam\BlogExample\Domain\Model\Person
+     */
     protected $reviewer = null;
 
     /**
@@ -75,6 +80,25 @@ class Post extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     protected $relatedPosts = null;
 
     /**
+     * 1:1 relation stored as CSV value in this class
+     * @var \ExtbaseTeam\BlogExample\Domain\Model\Info
+     */
+    protected $additionalName;
+
+    /**
+     * 1:1 relation stored as foreign key in Info class
+     * @var \ExtbaseTeam\BlogExample\Domain\Model\Info
+     */
+    protected $additionalInfo;
+
+    /**
+     * 1:n relation stored as CSV value
+     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\ExtbaseTeam\BlogExample\Domain\Model\Comment>
+     * @lazy
+     */
+    protected $additionalComments;
+
+    /**
      * Constructs this post
      */
     public function __construct()
@@ -84,6 +108,7 @@ class Post extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
         $this->comments = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
         $this->relatedPosts = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
         $this->date = new \DateTime();
+        $this->additionalComments = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
     }
 
     /**
@@ -259,6 +284,22 @@ class Post extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     /**
      * @return \ExtbaseTeam\BlogExample\Domain\Model\Person
      */
+    public function getSecondAuthor()
+    {
+        return $this->secondAuthor;
+    }
+
+    /**
+     * @param \ExtbaseTeam\BlogExample\Domain\Model\Person $secondAuthor
+     */
+    public function setSecondAuthor(\ExtbaseTeam\BlogExample\Domain\Model\Person $secondAuthor)
+    {
+        $this->secondAuthor = $secondAuthor;
+    }
+
+    /**
+     * @return \ExtbaseTeam\BlogExample\Domain\Model\Person
+     */
     public function getReviewer()
     {
         return $this->reviewer;
@@ -381,6 +422,79 @@ class Post extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     }
 
     /**
+     * @return Info|null
+     */
+    public function getAdditionalName()
+    {
+        return $this->additionalName;
+    }
+
+    /**
+     * @param Info $additionalName
+     */
+    public function setAdditionalName(Info $additionalName)
+    {
+        $this->additionalName = $additionalName;
+    }
+
+    /**
+     * @return Info|null
+     */
+    public function getAdditionalInfo()
+    {
+        return $this->additionalInfo;
+    }
+
+    /**
+     * @param Info $additionalInfo
+     */
+    public function setAdditionalInfo(Info $additionalInfo)
+    {
+        $this->additionalInfo = $additionalInfo;
+    }
+
+    /**
+     * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+     */
+    public function getAdditionalComments(): \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+    {
+        return $this->additionalComments;
+    }
+
+    /**
+     * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $additionalComments
+     */
+    public function setAdditionalComments(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $additionalComments)
+    {
+        $this->additionalComments = $additionalComments;
+    }
+
+    /**
+     * @param Comment $comment
+     */
+    public function addAdditionalComment(Comment $comment)
+    {
+        $this->additionalComments->attach($comment);
+    }
+
+    /**
+     * Remove all additional Comments
+     */
+    public function removeAllAdditionalComments()
+    {
+        $comments = clone $this->additionalComments;
+        $this->additionalComments->removeAll($comments);
+    }
+
+    /**
+     * @param Comment $comment
+     */
+    public function removeAdditionalComment(Comment $comment)
+    {
+        $this->additionalComments->detach($comment);
+    }
+
+    /**
      * Returns this post as a formatted string
      *
      * @return string
index 01ea772..69861e6 100644 (file)
@@ -66,7 +66,7 @@ return [
         ],
         'hidden' => [
             'exclude' => true,
-            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.hidden',
+            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
             'config' => [
                 'type' => 'check'
             ]
index 9bce7a5..2f301d4 100644 (file)
@@ -19,7 +19,7 @@ return [
     'columns' => [
         'hidden' => [
             'exclude' => true,
-            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.hidden',
+            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
             'config' => [
                 'type' => 'check'
             ]
diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_info.php b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_info.php
new file mode 100644 (file)
index 0000000..5cc4655
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+
+return [
+    'ctrl' => [
+        'title' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_info',
+        'label' => 'name',
+        'tstamp' => 'tstamp',
+        'crdate' => 'crdate',
+        'versioningWS' => true,
+        'languageField' => 'sys_language_uid',
+        'transOrigPointerField' => 'l18n_parent',
+        'transOrigDiffSourceField' => 'l18n_diffsource',
+        'delete' => 'deleted',
+        'sortby' => 'sorting',
+        'enablecolumns' => [
+            'disabled' => 'hidden'
+        ],
+        'iconfile' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_tag.gif'
+    ],
+    'interface' => [
+        'showRecordFieldList' => 'hidden, name'
+    ],
+    'columns' => [
+        'sys_language_uid' => [
+            'exclude' => true,
+            'label' => 'LLL:ext:lang/Resources/Private/Language/locallang_general.xlf:LGL.language',
+            'config' => [
+                'type' => 'select',
+                'renderType' => 'selectSingle',
+                'special' => 'languages',
+                'items' => [
+                    [
+                        'LLL:ext:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
+                        -1,
+                        'flags-multiple'
+                    ],
+                ],
+                'default' => 0,
+            ]
+        ],
+        'l18n_parent' => [
+            'exclude' => true,
+            'displayCond' => 'FIELD:sys_language_uid:>:0',
+            'label' => 'LLL:ext:lang/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
+            'config' => [
+                'type' => 'select',
+                'renderType' => 'selectSingle',
+                'items' => [
+                    ['', 0],
+                ],
+                'foreign_table' => 'tx_blogexample_domain_model_info',
+                'foreign_table_where' => 'AND tx_blogexample_domain_model_info.pid=###CURRENT_PID### AND tx_blogexample_domain_model_info.sys_language_uid IN (-1,0)',
+                'default' => 0
+            ]
+        ],
+        'l18n_diffsource' => [
+            'config' => [
+                'type' => 'passthrough',
+                'default' => '',
+            ],
+        ],
+        'hidden' => [
+            'exclude' => true,
+            'label' => 'LLL:ext:lang/Resources/Private/Language/locallang_general.xlf:LGL.visible',
+            'config' => [
+                'type' => 'check',
+                'renderType' => 'checkboxToggle',
+                'items' => [
+                    [
+                        0 => '',
+                        1 => '',
+                        'invertStateDisplay' => true
+                    ]
+                ],
+            ]
+        ],
+        'name' => [
+            'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_info.name',
+            'config' => [
+                'type' => 'input',
+                'size' => 20,
+                'eval' => 'trim, required',
+                'max' => 256
+            ]
+        ],
+        'post' => [
+            'config' => [
+                'type' => 'passthrough',
+            ]
+        ],
+    ],
+    'types' => [
+        0 => ['showitem' => 'sys_language_uid, l18n_parent, hidden, name']
+    ],
+];
index d8ca486..d2701b2 100644 (file)
@@ -9,7 +9,9 @@ return [
         'crdate' => 'crdate',
         'versioningWS' => true,
         'origUid' => 't3_origuid',
-        'prependAtCopy' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.prependAtCopy',
+        'languageField' => 'sys_language_uid',
+        'transOrigPointerField' => 'l10n_parent',
+        'prependAtCopy' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.prependAtCopy',
         'delete' => 'deleted',
         'enablecolumns' => [
             'disabled' => 'hidden'
@@ -20,9 +22,40 @@ return [
         'showRecordFieldList' => 'firstname, lastname, email, avatar'
     ],
     'columns' => [
+        'sys_language_uid' => [
+            'exclude' => true,
+            'label' => 'LLL:ext:lang/Resources/Private/Language/locallang_general.xlf:LGL.language',
+            'config' => [
+                'type' => 'select',
+                'renderType' => 'selectSingle',
+                'special' => 'languages',
+                'items' => [
+                    [
+                        'LLL:ext:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
+                        -1,
+                        'flags-multiple'
+                    ],
+                ],
+                'default' => 0
+            ]
+        ],
+        'l10n_parent' => [
+            'displayCond' => 'FIELD:sys_language_uid:>:0',
+            'exclude' => true,
+            'label' => 'LLL:ext:lang/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
+            'config' => [
+                'type' => 'select',
+                'renderType' => 'selectSingle',
+                'items' => [
+                    ['', 0],
+                ],
+                'foreign_table' => 'tx_blogexample_domain_model_person',
+                'foreign_table_where' => 'AND tx_blogexample_domain_model_person.uid=###REC_FIELD_l10n_parent### AND tx_blogexample_domain_model_person.sys_language_uid IN (-1,0)',
+            ]
+        ],
         'hidden' => [
             'exclude' => true,
-            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.hidden',
+            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
             'config' => [
                 'type' => 'check'
             ]
@@ -91,7 +124,7 @@ return [
         ],
     ],
     'types' => [
-        '1' => ['showitem' => 'firstname, lastname, email, avatar, tags, tags_special']
+        '1' => ['showitem' => 'sys_language_uid, firstname, lastname, email, avatar, tags, tags_special']
     ],
     'palettes' => [
         '1' => ['showitem' => '']
index c43f6d4..e387c5f 100644 (file)
@@ -24,7 +24,7 @@ return [
         'maxSingleDBListItems' => 500
     ],
     'types' => [
-        '1' => ['showitem' => 'sys_language_uid, hidden, blog, title, date, author, content, tags, comments, related_posts']
+        '1' => ['showitem' => 'sys_language_uid, hidden, blog, title, date, author, second_author, content, tags, comments, related_posts, additional_name, additional_info, additional_comments']
     ],
     'columns' => [
         'sys_language_uid' => [
@@ -64,7 +64,7 @@ return [
         ],
         'hidden' => [
             'exclude' => true,
-            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.hidden',
+            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
             'config' => [
                 'type' => 'check'
             ]
@@ -119,6 +119,28 @@ return [
                 ],
             ],
         ],
+        'second_author' => [
+            'exclude' => true,
+            'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_post.second_author',
+            'config' => [
+                'type' => 'group',
+                'internal_type' => 'db',
+                'allowed' => 'tx_blogexample_domain_model_person',
+                'foreign_table' => 'tx_blogexample_domain_model_person',
+                'maxitems' => 1,
+                'fieldControl' => [
+                    'editPopup' => [
+                        'disabled' => false,
+                    ],
+                    'addRecord' => [
+                        'disabled' => false,
+                    ],
+                    'listModule' => [
+                        'disabled' => false,
+                    ],
+                ],
+            ],
+        ],
         'reviewer' => [
             'exclude' => true,
             'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_post.reviewer',
@@ -194,5 +216,36 @@ return [
                 'MM_opposite_field' => 'related_posts',
             ]
         ],
+        'additional_name' => [
+            'exclude' => true,
+            'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_post.additional_name',
+            'config' => [
+                'type' => 'inline', // this will store the info uid in the additional_name field (CSV)
+                'foreign_table' => 'tx_blogexample_domain_model_info',
+                'minitems' => 0,
+                'maxitems' => 1,
+            ],
+        ],
+        'additional_info' => [
+            'exclude' => true,
+            'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_post.additional_info',
+            'config' => [
+                'type' => 'inline', // this will store the post uid in the post field of the info table
+                'foreign_table' => 'tx_blogexample_domain_model_info',
+                'foreign_field' => 'post',
+                'minitems' => 0,
+                'maxitems' => 1,
+            ],
+        ],
+        'additional_comments' => [
+            'exclude' => true,
+            'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_post.additional_comments',
+            'config' => [
+                'type' => 'inline', // this will store the comments uids in the additional_comments field (CSV)
+                'foreign_table' => 'tx_blogexample_domain_model_comment',
+                'minitems' => 0,
+                'maxitems' => 200,
+            ],
+        ],
     ]
 ];
index 7840174..e5e880c 100644 (file)
@@ -53,7 +53,7 @@ return [
         ],
         'hidden' => [
             'exclude' => true,
-            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.hidden',
+            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
             'config' => [
                 'type' => 'check'
             ]
index 3d74357..1667f65 100644 (file)
                        <label index="tx_blogexample_domain_model_post.subtitle">Title</label>
                        <label index="tx_blogexample_domain_model_post.date">Date</label>
                        <label index="tx_blogexample_domain_model_post.author">Author</label>
+                       <label index="tx_blogexample_domain_model_post.second_author">Second author</label>
+                       <label index="tx_blogexample_domain_model_post.reviewer">Reviewer</label>
                        <label index="tx_blogexample_domain_model_post.content">Content</label>
                        <label index="tx_blogexample_domain_model_post.votes">Votes</label>
                        <label index="tx_blogexample_domain_model_post.published">Published</label>
                        <label index="tx_blogexample_domain_model_post.tags">Tags</label>
                        <label index="tx_blogexample_domain_model_post.comments">Comments</label>
                        <label index="tx_blogexample_domain_model_post.related">Related posts</label>
+                       <label index="tx_blogexample_domain_model_post.additional_info">Additional info (inline 1:1 foreign_field)</label>
+                       <label index="tx_blogexample_domain_model_post.additional_name">Additional name (inline 1:1 csv)</label>
+                       <label index="tx_blogexample_domain_model_post.additional_comments">Additional comments (inline 1:n csv)</label>
                        <label index="tx_blogexample_domain_model_person">Person</label>
                        <label index="tx_blogexample_domain_model_person.firstname">Firstname</label>
                        <label index="tx_blogexample_domain_model_person.lastname">Lastname</label>
@@ -40,6 +45,9 @@
                        <label index="tx_blogexample_domain_model_tag">Tag</label>
                        <label index="tx_blogexample_domain_model_tag.name">Name</label>
                        <label index="tx_blogexample_domain_model_tag.posts">Related posts</label>
+                       <label index="tx_blogexample_domain_model_info">Additional Info</label>
+                       <label index="tx_blogexample_domain_model_info.name">Additional name</label>
+                       <label index="tx_blogexample_domain_model_info.post">Post - parent</label>
                        <label index="tx_blogexample_domain_model_dateexample">Date example</label>
                        <label index="fe_users.tx_extbase_type.ExtbaseTeam\BlogExample\Domain\Model\Administrator">Blog Admin (BlogExample)</label>
                </languageKey>
index 7794b40..57976d4 100644 (file)
@@ -50,12 +50,16 @@ CREATE TABLE tx_blogexample_domain_model_post (
 
        title varchar(255) DEFAULT '' NOT NULL,
        date int(11) DEFAULT '0' NOT NULL,
-       author int(255) DEFAULT '0' NOT NULL,
-       reviewer int(255) DEFAULT '0' NOT NULL,
+       author int(11) DEFAULT '0' NOT NULL,
+       second_author int(11) DEFAULT '0' NOT NULL,
+       reviewer int(11) DEFAULT '0' NOT NULL,
        content text NOT NULL,
        tags int(11) unsigned DEFAULT '0' NOT NULL,
        comments int(11) unsigned DEFAULT '0' NOT NULL,
        related_posts int(11) unsigned DEFAULT '0' NOT NULL,
+       additional_name varchar(255) DEFAULT '' NOT NULL,
+       additional_info int(11) DEFAULT '0' NOT NULL,
+       additional_comments varchar(255) DEFAULT '' NOT NULL,
 
        tstamp int(11) unsigned DEFAULT '0' NOT NULL,
        crdate int(11) unsigned DEFAULT '0' NOT NULL,
@@ -124,6 +128,9 @@ CREATE TABLE tx_blogexample_domain_model_person (
        deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
        hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
 
+       sys_language_uid int(11) DEFAULT '0' NOT NULL,
+       l10n_parent int(11) DEFAULT '0' NOT NULL,
+
        t3ver_oid int(11) DEFAULT '0' NOT NULL,
        t3ver_id int(11) DEFAULT '0' NOT NULL,
        t3ver_wsid int(11) DEFAULT '0' NOT NULL,
@@ -224,3 +231,38 @@ CREATE TABLE tx_blogexample_domain_model_dateexample (
        PRIMARY KEY (uid),
        KEY parent (pid)
 );
+
+#
+# Table structure for table 'tx_blogexample_domain_model_info'
+#
+CREATE TABLE tx_blogexample_domain_model_info (
+       uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
+       pid int(11) DEFAULT '0' NOT NULL,
+
+       name varchar(255) DEFAULT '' NOT NULL,
+       post int(11) DEFAULT '0' NOT NULL,
+
+       tstamp int(11) unsigned DEFAULT '0' NOT NULL,
+       crdate int(11) unsigned DEFAULT '0' NOT NULL,
+       deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
+       hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
+
+       sys_language_uid int(11) DEFAULT '0' NOT NULL,
+       l18n_parent int(11) DEFAULT '0' NOT NULL,
+       l18n_diffsource mediumblob,
+
+       t3ver_oid int(11) DEFAULT '0' NOT NULL,
+       t3ver_id int(11) DEFAULT '0' NOT NULL,
+       t3ver_wsid int(11) DEFAULT '0' NOT NULL,
+       t3ver_label varchar(30) DEFAULT '' NOT NULL,
+       t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
+       t3ver_stage tinyint(4) DEFAULT '0' NOT NULL,
+       t3ver_count int(11) DEFAULT '0' NOT NULL,
+       t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
+       t3ver_move_id int(11) DEFAULT '0' NOT NULL,
+       t3_origuid int(11) DEFAULT '0' NOT NULL,
+
+       PRIMARY KEY (uid),
+       KEY parent (pid),
+       KEY t3ver_oid (t3ver_oid,t3ver_wsid)
+);