'smsemail' => array('type' => 'varchar', 'length' => 255, 'description' => 'built from sms and carrier'),
'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universally unique identifier, usually a tag URI'),
'autosubscribe' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'automatically subscribe to users who subscribe to us'),
+ 'subscribe_policy' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => '0 = anybody can subscribe; 1 = require approval'),
'urlshorteningservice' => array('type' => 'varchar', 'length' => 50, 'default' => 'internal', 'description' => 'service to use for auto-shortening URLs'),
'inboxed' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'has an inbox been created for this user?'),
- 'design_id' => array('type' => 'int', 'description' => 'id of a design'),
- 'viewdesigns' => array('type' => 'int', 'size' => 'tiny', 'default' => 1, 'description' => 'whether to view user-provided designs'),
+ 'private_stream' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'whether to limit all notices to followers only'),
'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'),
'foreign keys' => array(
'user_id_fkey' => array('profile', array('id' => 'id')),
'user_carrier_fkey' => array('sms_carrier', array('carrier' => 'id')),
- 'user_design_id_fkey' => array('design', array('design_id' => 'id')),
),
'indexes' => array(
'user_smsemail_idx' => array('smsemail'),
'address' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'invitation sent to'),
'address_type' => array('type' => 'varchar', 'length' => 8, 'not null' => true, 'description' => 'address type ("email", "xmpp", "sms")'),
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
+ 'registered_user_id' => array('type' => 'int', 'not null' => false, 'description' => 'if the invitation is converted, who the new user is'),
),
'primary key' => array('code'),
'foreign keys' => array(
'invitation_user_id_fkey' => array('user', array('user_id' => 'id')),
+ 'invitation_registered_user_id_fkey' => array('user', array('registered_user_id' => 'id')),
),
'indexes' => array(
'invitation_address_idx' => array('address', 'address_type'),
'invitation_user_id_idx' => array('user_id'),
+ 'invitation_registered_user_id_idx' => array('registered_user_id'),
),
);
),
'primary key' => array('tagger', 'tagged', 'tag'),
'foreign keys' => array(
- 'profile_tag_tagger_fkey' => array('user', array('tagger' => 'id')),
+ 'profile_tag_tagger_fkey' => array('profile', array('tagger' => 'id')),
'profile_tag_tagged_fkey' => array('profile', array('tagged' => 'id')),
+ 'profile_tag_tag_fkey' => array('profile_list', array('tag' => 'tag')),
),
'indexes' => array(
'profile_tag_modified_idx' => array('modified'),
),
);
+$schema['profile_list'] = array(
+ 'fields' => array(
+ 'id' => array('type' => 'serial', 'not null' => true, 'description' => 'unique identifier'),
+ 'tagger' => array('type' => 'int', 'not null' => true, 'description' => 'user making the tag'),
+ 'tag' => array('type' => 'varchar', 'length' => 64, 'not null' => true, 'description' => 'people tag'),
+ 'description' => array('type' => 'text', 'description' => 'description of the people tag'),
+ 'private' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'is this tag private'),
+
+ 'created' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date the tag was added'),
+ 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date the tag was modified'),
+
+ 'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universal identifier'),
+ 'mainpage' => array('type' => 'varchar', 'length' => 255, 'description' => 'page to link to'),
+ 'tagged_count' => array('type' => 'int', 'default' => 0, 'description' => 'number of people tagged with this tag by this user'),
+ 'subscriber_count' => array('type' => 'int', 'default' => 0, 'description' => 'number of subscribers to this tag'),
+ ),
+ 'primary key' => array('tagger', 'tag'),
+ 'unique keys' => array(
+ 'profile_list_id_key' => array('id')
+ ),
+ 'foreign keys' => array(
+ 'profile_list_tagger_fkey' => array('profile', array('tagger' => 'id')),
+ ),
+ 'indexes' => array(
+ 'profile_list_modified_idx' => array('modified'),
+ 'profile_list_tag_idx' => array('tag'),
+ 'profile_list_tagger_tag_idx' => array('tagger', 'tag'),
+ 'profile_list_tagged_count_idx' => array('tagged_count'),
+ 'profile_list_subscriber_count_idx' => array('subscriber_count'),
+ ),
+);
+
+$schema['profile_tag_inbox'] = array(
+ 'description' => 'Many-many table listing notices associated with people tags.',
+ 'fields' => array(
+ 'profile_tag_id' => array('type' => 'int', 'not null' => true, 'description' => 'people tag receiving the message'),
+ 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice received'),
+ 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date the notice was created'),
+ ),
+ 'primary key' => array('profile_tag_id', 'notice_id'),
+ 'foreign keys' => array(
+ 'profile_tag_inbox_profile_list_id_fkey' => array('profile_list', array('profile_tag_id' => 'id')),
+ 'profile_tag_inbox_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
+ ),
+ 'indexes' => array(
+ 'profile_tag_inbox_created_idx' => array('created'),
+ 'profile_tag_inbox_profile_tag_id_idx' => array('profile_tag_id'),
+ ),
+);
+
+$schema['profile_tag_subscription'] = array(
+ 'fields' => array(
+ 'profile_tag_id' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to profile_tag'),
+ 'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to profile table'),
+
+ '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('profile_tag_id', 'profile_id'),
+ 'foreign keys' => array(
+ 'profile_tag_subscription_profile_list_id_fkey' => array('profile_list', array('profile_tag_id' => 'id')),
+ 'profile_tag_subscription_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
+ ),
+ 'indexes' => array(
+ // @fixme probably we want a (profile_id, created) index here?
+ 'profile_tag_subscription_profile_id_idx' => array('profile_id'),
+ 'profile_tag_subscription_created_idx' => array('created'),
+ ),
+);
+
$schema['profile_block'] = array(
'fields' => array(
'blocker' => array('type' => 'int', 'not null' => true, 'description' => 'user making the block'),
'homepage_logo' => array('type' => 'varchar', 'length' => 255, 'description' => 'homepage (profile) size logo'),
'stream_logo' => array('type' => 'varchar', 'length' => 255, 'description' => 'stream-sized logo'),
'mini_logo' => array('type' => 'varchar', 'length' => 255, 'description' => 'mini logo'),
- 'design_id' => array('type' => 'int', 'description' => 'id of a design'),
'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'),
'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universal identifier'),
'mainpage' => array('type' => 'varchar', 'length' => 255, 'description' => 'page for group info to link to'),
- 'join_policy' => array('type' => 'int', 'size' => 'tiny', 'description' => '0=open; 1=requires admin approval'),
+ 'join_policy' => array('type' => 'int', 'size' => 'tiny', 'description' => '0=open; 1=requires admin approval'),
+ 'force_scope' => array('type' => 'int', 'size' => 'tiny', 'description' => '0=never,1=sometimes,-1=always'),
),
'primary key' => array('id'),
'unique keys' => array(
'user_group_uri_key' => array('uri'),
),
- 'foreign keys' => array(
- 'user_group_design_id_fkey' => array('design', array('design_id' => 'id')),
- ),
'indexes' => array(
'user_group_nickname_idx' => array('nickname'),
),
),
);
-$schema['design'] = array(
- 'fields' => array(
- 'id' => array('type' => 'serial', 'not null' => true, 'description' => 'design ID'),
- 'backgroundcolor' => array('type' => 'int', 'description' => 'main background color'),
- 'contentcolor' => array('type' => 'int', 'description' => 'content area background color'),
- 'sidebarcolor' => array('type' => 'int', 'description' => 'sidebar background color'),
- 'textcolor' => array('type' => 'int', 'description' => 'text color'),
- 'linkcolor' => array('type' => 'int', 'description' => 'link color'),
- 'backgroundimage' => array('type' => 'varchar', 'length' => 255, 'description' => 'background image, if any'),
- 'disposition' => array('type' => 'int', 'size' => 'tiny', 'default' => 1, 'description' => 'bit 1 = hide background image, bit 2 = display background image, bit 4 = tile background image'),
- ),
- 'primary key' => array('id'),
-);
-
$schema['group_block'] = array(
'fields' => array(
'group_id' => array('type' => 'int', 'not null' => true, 'description' => 'group profile is blocked from'),
);
$schema['group_join_queue'] = Group_join_queue::schemaDef();
+
+$schema['subscription_queue'] = Subscription_queue::schemaDef();
+
+$schema['oauth_token_association'] = Oauth_token_association::schemaDef();