]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - db/statusnet_pg.sql
Initial functional version of feed subscription plugin, currently supporting only...
[quix0rs-gnu-social.git] / db / statusnet_pg.sql
index 672877ddf0bac25ba3bdfdbcb0c18e8a14460470..27b189e288d24485018b391b52dfd954f35534d6 100644 (file)
@@ -115,8 +115,8 @@ create table subscription (
 
     primary key (subscriber, subscribed)
 );
-create index subscription_subscriber_idx on subscription using btree(subscriber);
-create index subscription_subscribed_idx on subscription using btree(subscribed);
+create index subscription_subscriber_idx on subscription using btree(subscriber,created);
+create index subscription_subscribed_idx on subscription using btree(subscribed,created);
 
 create sequence notice_seq;
 create table notice (
@@ -137,7 +137,7 @@ create table notice (
 
 /*    FULLTEXT(content) */
 );
-create index notice_profile_id_idx on notice using btree(profile_id);
+create index notice_profile_id_idx on notice using btree(profile_id,created,id);
 create index notice_created_idx on notice using btree(created);
 
 create table notice_source (
@@ -171,7 +171,7 @@ create table fave (
 
 );
 create index fave_notice_id_idx on fave using btree(notice_id);
-create index fave_user_id_idx on fave using btree(user_id);
+create index fave_user_id_idx on fave using btree(user_id,modified);
 create index fave_modified_idx on fave using btree(modified);
 
 /* tables for OAuth */
@@ -560,12 +560,12 @@ create table config (
 
 );
 
-create table user_role (
+create table profile_role (
 
-    user_id integer not null /* comment 'user having the role'*/ references "user" (id),
+    profile_id integer not null /* comment 'account having the role'*/ references profile (id),
     role    varchar(32) not null /* comment 'string representing the role'*/,
     created timestamp /* not null comment 'date the role was granted'*/,
 
-    primary key (user_id, role)
+    primary key (profile_id, role)
 
-);
+);
\ No newline at end of file