]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Foreign_user.php
move core schema to class files
[quix0rs-gnu-social.git] / classes / Foreign_user.php
index 82ca749a5946d7cfa4df806b43b29187979d7ed6..67d8651fa97537f0bde2061bc188775a911d9eda 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
 
-class Foreign_user extends Memcached_DataObject
+class Foreign_user extends Managed_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -23,6 +23,27 @@ class Foreign_user extends Memcached_DataObject
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
+    public static function schemaDef()
+    {
+        return array(
+            'fields' => array(
+                'id' => array('type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'unique numeric key on foreign service'),
+                'service' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to service'),
+                'uri' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'identifying URI'),
+                'nickname' => array('type' => 'varchar', 'length' => 255, 'description' => 'nickname on foreign service'),
+                'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
+                'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
+            ),
+            'primary key' => array('id', 'service'),
+            'foreign keys' => array(
+                'foreign_user_service_fkey' => array('foreign_service', array('service' => 'id')),
+            ),
+            'unique keys' => array(
+                'foreign_user_uri_key' => array('uri'),
+            ),
+        );
+    }
+
     // XXX:  This only returns a 1->1 single obj mapping.  Change?  Or make
     // a getForeignUsers() that returns more than one? --Zach
     static function getForeignUser($id, $service) {