comparison db/to_idavoll_0.8.sql @ 206:274a45d2a5ab

Implement root collection that includes all leaf nodes.
author Ralph Meijer <ralphm@ik.nu>
date Mon, 04 Aug 2008 13:47:10 +0000
parents
children
comparison
equal deleted inserted replaced
205:e6b710bf2b24 206:274a45d2a5ab
1 ALTER TABLE affiliations RENAME id TO affiliation_id;
2
3 ALTER TABLE entities RENAME id TO entity_id;
4
5 ALTER TABLE items RENAME id TO item_id;
6
7 ALTER TABLE nodes RENAME id TO node_id;
8 ALTER TABLE nodes RENAME persistent to persist_items;
9 ALTER TABLE nodes RENAME deliver_payload to deliver_payloads;
10 ALTER TABLE nodes ADD COLUMN node_type text;
11 ALTER TABLE nodes ALTER COLUMN node_type SET DEFAULT 'leaf';
12 UPDATE nodes SET node_type = 'leaf';
13 ALTER TABLE nodes ALTER COLUMN node_type SET NOT NULL;
14 ALTER TABLE nodes ADD CHECK (node_type IN ('leaf', 'collection'));
15 ALTER TABLE nodes ALTER COLUMN persistent DROP NOT NULL;
16 ALTER TABLE nodes ALTER COLUMN persistent DROP DEFAULT;
17
18 ALTER TABLE subscriptions RENAME id TO subscription_id;
19 ALTER TABLE subscriptions RENAME subscription TO state;
20 ALTER TABLE subscriptions ADD COLUMN subscription_type text
21 CHECK (subscription_type IN (NULL, 'items', 'nodes'));
22 ALTER TABLE subscriptions ADD COLUMN subscription_depth text
23 CHECK (subscription_depth IN (NULL, '1', 'all'));
24
25 INSERT INTO nodes (node, node_type) values ('', 'collection');