]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - db/statusnet_pg.sql
Merge branch '0.9.x' into mapstraction
[quix0rs-gnu-social.git] / db / statusnet_pg.sql
index 0e5e96c327ed718ff4f597f831edf8181bcfd0c7..8dbaf8598142e1715c7ff726db8d809a8a764add 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 */
@@ -571,11 +571,11 @@ create table user_role (
 );
 
 create table login_token (
-    user_id integer not null /* comment 'user owning this token'*/ references user (id),
+    user_id integer not null /* comment 'user owning this token'*/ references "user" (id),
     token char(32) not null /* comment 'token useable for logging in'*/,
     created timestamp not null DEFAULT CURRENT_TIMESTAMP /* comment 'date this record was created'*/,
     modified timestamp /* comment 'date this record was modified'*/,
 
-    constraint primary key (user_id)
+    primary key (user_id)
 );