+ public static function schemaDef()
+ {
+ return array(
+ 'fields' => array(
+ 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice that is the favorite'),
+ 'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user who likes this notice'),
+ 'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universally unique identifier, usually a tag URI'),
+ 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
+ ),
+ 'primary key' => array('notice_id', 'user_id'),
+ 'unique keys' => array(
+ 'fave_uri_key' => array('uri'),
+ ),
+ 'foreign keys' => array(
+ 'fave_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
+ 'fave_user_id_fkey' => array('profile', array('user_id' => 'id')), // note: formerly referenced notice.id, but we can now record remote users' favorites
+ ),
+ 'indexes' => array(
+ 'fave_notice_id_idx' => array('notice_id'),
+ 'fave_user_id_idx' => array('user_id', 'modified'),
+ 'fave_modified_idx' => array('modified'),
+ ),
+ );
+ }
+