]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - db/core.php
Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
[quix0rs-gnu-social.git] / db / core.php
index f44a85cad7efd2e16f3d8f45b8ec29db47d3fb2a..a9632fe8d4dbb4a6bcb21b032e467d22b1392318 100644 (file)
@@ -121,8 +121,7 @@ $schema['user'] = array(
         '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'),
@@ -138,7 +137,6 @@ $schema['user'] = array(
     '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'),
@@ -203,6 +201,9 @@ $schema['notice'] = array(
         'location_ns' => array('type' => 'int', 'description' => 'namespace for location'),
         'repeat_of' => array('type' => 'int', 'description' => 'notice this is a repeat of'),
         'object_type' => array('type' => 'varchar', 'length' => 255, 'description' => 'URI representing activity streams object type', 'default' => 'http://activitystrea.ms/schema/1.0/note'),
+        'scope' => array('type' => 'int',
+                         'default' => '1',
+                         'description' => 'bit map for distribution scope; 0 = everywhere; 1 = this server only; 2 = addressees; 4 = followers'),
     ),
     'primary key' => array('id'),
     'unique keys' => array(
@@ -538,14 +539,17 @@ $schema['invitation'] = array(
         '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'),
     ),
 );
 
@@ -606,8 +610,9 @@ $schema['profile_tag'] = array(
     ),
     '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'),
@@ -616,6 +621,76 @@ $schema['profile_tag'] = array(
     ),
 );
 
+$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'),
@@ -643,22 +718,19 @@ $schema['user_group'] = array(
         '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'),
     ),
@@ -807,20 +879,6 @@ $schema['file_to_post'] = array(
     ),
 );
 
-$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'),
@@ -1031,3 +1089,5 @@ $schema['schema_version'] = array(
 $schema['group_join_queue'] = Group_join_queue::schemaDef();
 
 $schema['subscription_queue'] = Subscription_queue::schemaDef();
+
+$schema['oauth_token_association'] = Oauth_token_association::schemaDef();