summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrenda <brenda@pukeko.(none)>2009-11-14 16:34:36 +1300
committerbrenda <brenda@pukeko.(none)>2009-11-14 16:34:36 +1300
commitab135faa7525924edc250850e9a6bcbc6ca4cee2 (patch)
treee5be384b40a682c6ca0193696e5cb4cb652a146f
parent5fab9bed48944d8328ef4d1b0c84bb1c67632c5d (diff)
postgresl update script now working in postgres
-rw-r--r--db/08to09_pg.sql25
1 files changed, 12 insertions, 13 deletions
diff --git a/db/08to09_pg.sql b/db/08to09_pg.sql
index fe9eccb2a..d9b57fb84 100644
--- a/db/08to09_pg.sql
+++ b/db/08to09_pg.sql
@@ -40,24 +40,23 @@ 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)
);
-alter table fave
- drop index fave_user_id_idx,
- add index fave_user_id_idx using btree(user_id,modified);
+DROP index fave_user_id_idx;
+CREATE index fave_user_id_idx on fave (user_id,modified);
-alter table subscription
- drop index subscription_subscriber_idx,
- add index subscription_subscriber_idx using btree(subscriber,created),
- drop index subscription_subscribed_idx,
- add index subscription_subscribed_idx using btree(subscribed,created);
+DROP index subscription_subscriber_idx;
+CREATE index subscription_subscriber_idx ON subscription (subscriber,created);
+
+DROP index subscription_subscribed_idx;
+CREATE index subscription_subscribed_idx ON subscription (subscribed,created);
+
+DROP index notice_profile_id_idx;
+CREATE index notice_profile_id_idx ON notice (profile_id,created,id);
-alter table notice
- drop index notice_profile_id_idx,
- add index notice_profile_id_idx using btree(profile_id,created,id);