]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Related_group.php
move core schema to class files
[quix0rs-gnu-social.git] / classes / Related_group.php
index c00ad9c44e64e975df4c82da019743ea4c8ef8a3..67d6ce3fc75b29e6a0e23a002c772331070b9363 100644 (file)
@@ -3,7 +3,7 @@
  * Table Definition for related_group
  */
 
-class Related_group extends Memcached_DataObject
+class Related_group extends Managed_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -18,4 +18,22 @@ class Related_group extends Memcached_DataObject
 
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
+
+    public static function schemaDef()
+    {
+        return array(
+            // @fixme description for related_group?
+            'fields' => array(
+                'group_id' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to user_group'),
+                'related_group_id' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to user_group'),
+
+                'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
+            ),
+            'primary key' => array('group_id', 'related_group_id'),
+            'foreign keys' => array(
+                'related_group_group_id_fkey' => array('user_group', array('group_id' => 'id')),
+                'related_group_related_group_id_fkey' => array('user_group', array('related_group_id' => 'id')),
+            ),
+        );
+    }
 }