]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/File_redirection.php
Remove sequenceKey() since we now use Managed_DataObject
[quix0rs-gnu-social.git] / classes / File_redirection.php
index 1096f500bfcc701366eb3eb6cb8a34ea40a07824..130d9e7d74751bedba7fd4522a9f472bde81620e 100644 (file)
@@ -23,13 +23,11 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
 require_once INSTALLDIR.'/classes/File.php';
 require_once INSTALLDIR.'/classes/File_oembed.php';
 
-define('USER_AGENT', 'StatusNet user agent / file probe');
-
 /**
  * Table Definition for file_redirection
  */
 
-class File_redirection extends Memcached_DataObject
+class File_redirection extends Managed_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -47,6 +45,23 @@ class File_redirection 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(
+                'url' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'short URL (or any other kind of redirect) for file (id)'),
+                'file_id' => array('type' => 'int', 'description' => 'short URL for what URL/file'),
+                'redirections' => array('type' => 'int', 'description' => 'redirect count'),
+                'httpcode' => array('type' => 'int', 'description' => 'HTTP status code (20x, 30x, etc.)'),
+                'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
+            ),
+            'primary key' => array('url'),
+            'foreign keys' => array(
+                'file_redirection_file_id_fkey' => array('file' => array('file_id' => 'id')),
+            ),
+        );
+    }
+
     static function _commonHttp($url, $redirs) {
         $request = new HTTPClient($url);
         $request->setConfig(array(