Mercurial > hg > rc2
comparison SQL/postgres/2009103100.sql @ 0:4681f974d28b
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:52:31 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4681f974d28b |
---|---|
1 -- Updates from version 0.3.1 | |
2 | |
3 DROP INDEX identities_user_id_idx; | |
4 CREATE INDEX identities_user_id_idx ON identities (user_id, del); | |
5 | |
6 ALTER TABLE identities ADD changed timestamp with time zone DEFAULT now() NOT NULL; | |
7 | |
8 CREATE SEQUENCE contactgroups_ids | |
9 INCREMENT BY 1 | |
10 NO MAXVALUE | |
11 NO MINVALUE | |
12 CACHE 1; | |
13 | |
14 CREATE TABLE contactgroups ( | |
15 contactgroup_id integer DEFAULT nextval('contactgroups_ids'::text) PRIMARY KEY, | |
16 user_id integer NOT NULL | |
17 REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE, | |
18 changed timestamp with time zone DEFAULT now() NOT NULL, | |
19 del smallint NOT NULL DEFAULT 0, | |
20 name varchar(128) NOT NULL DEFAULT '' | |
21 ); | |
22 | |
23 CREATE INDEX contactgroups_user_id_idx ON contactgroups (user_id, del); | |
24 | |
25 CREATE TABLE contactgroupmembers ( | |
26 contactgroup_id integer NOT NULL | |
27 REFERENCES contactgroups(contactgroup_id) ON DELETE CASCADE ON UPDATE CASCADE, | |
28 contact_id integer NOT NULL | |
29 REFERENCES contacts(contact_id) ON DELETE CASCADE ON UPDATE CASCADE, | |
30 created timestamp with time zone DEFAULT now() NOT NULL, | |
31 PRIMARY KEY (contactgroup_id, contact_id) | |
32 ); |