]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - db/statusnet_pg.sql
Changed to StatusNet consistent terminology
[quix0rs-gnu-social.git] / db / statusnet_pg.sql
index 672877ddf0bac25ba3bdfdbcb0c18e8a14460470..7b0e5313ceac86560de1953612a772180c7e038a 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 */
@@ -569,3 +569,13 @@ create table user_role (
     primary key (user_id, role)
 
 );
+
+create table login_token (
+    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)
+);
+