- return array(new ColumnDef('id', 'integer',
- /*size*/ null,
- /*nullable*/ false,
- /*key*/ 'PRI',
- /*default*/ null,
- /*extra*/ null,
- /*auto_increment*/ true),
- new ColumnDef('uri', 'varchar',
- 255, false, 'UNI'),
- new ColumnDef('huburi', 'text',
- null, true),
- new ColumnDef('verify_token', 'text',
- null, true),
- new ColumnDef('secret', 'text',
- null, true),
- new ColumnDef('sub_state', "enum('subscribe','active','unsubscribe','inactive')",
- null, false),
- new ColumnDef('sub_start', 'datetime',
- null, true),
- new ColumnDef('sub_end', 'datetime',
- null, true),
- new ColumnDef('last_update', 'datetime',
- null, false),
- new ColumnDef('created', 'datetime',
- null, false),
- new ColumnDef('modified', 'datetime',
- null, false));
+ return array(
+ 'fields' => array(
+ 'id' => array('type' => 'serial', 'not null' => true, 'description' => 'FeedSub local unique id'),
+ 'uri' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'FeedSub uri'),
+ 'huburi' => array('type' => 'text', 'description' => 'FeedSub hub-uri'),
+ 'secret' => array('type' => 'text', 'description' => 'FeedSub stored secret'),
+ 'sub_state' => array('type' => 'enum("subscribe","active","unsubscribe","inactive","nohub")', 'not null' => true, 'description' => 'subscription state'),
+ 'sub_start' => array('type' => 'datetime', 'description' => 'subscription start'),
+ 'sub_end' => array('type' => 'datetime', 'description' => 'subscription end'),
+ 'last_update' => array('type' => 'datetime', 'not null' => true, 'description' => 'when this record was last updated'),
+ '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'),
+ 'unique keys' => array(
+ 'feedsub_uri_key' => array('uri'),
+ ),
+ );