]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Nonce.php
move core schema to class files
[quix0rs-gnu-social.git] / classes / Nonce.php
index 93191bd409109d362e19672fb977af7390f0ec77..0cd9967a08465d94a997838e17d41b083d290688 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
 
-class Nonce extends Memcached_DataObject
+class Nonce extends Managed_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -36,4 +36,21 @@ class Nonce extends Memcached_DataObject
     {
         return array('consumer_key,token' => 'token:consumer_key,token');
     }
+
+    public static function schemaDef()
+    {
+        return array(
+            'description' => 'OAuth nonce record',
+            'fields' => array(
+                'consumer_key' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'unique identifier, root URL'),
+                'tok' => array('type' => 'char', 'length' => 32, 'description' => 'buggy old value, ignored'),
+                'nonce' => array('type' => 'char', 'length' => 32, 'not null' => true, 'description' => 'nonce'),
+                'ts' => array('type' => 'datetime', 'not null' => true, 'description' => 'timestamp sent'),
+
+                '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('consumer_key', 'ts', 'nonce'),
+        );
+    }
 }