view db/to_idavoll_0.8.sql @ 222:698af5d720ad

Reshape Idavoll as a PubSubResource. PubSubResource is Wokkel's newer interface for building (parts of) XMPP publish-subscribe services and replaces the old interface of PubSubService. It is more flexible for adding new protocol, allows for node-as-code (providing a specific backend per node), and permits accepting requests for different entities (virtual hosts or PEP-like settings). This moves over the current backend to use the new interface, so new code for previously unsupported protocol can be added down the line.
author Ralph Meijer <ralphm@ik.nu>
date Sat, 16 Oct 2010 21:03:38 +0200
parents 274a45d2a5ab
children
line wrap: on
line source

ALTER TABLE affiliations RENAME id TO affiliation_id;

ALTER TABLE entities RENAME id TO entity_id;

ALTER TABLE items RENAME id TO item_id;

ALTER TABLE nodes RENAME id TO node_id;
ALTER TABLE nodes RENAME persistent to persist_items;
ALTER TABLE nodes RENAME deliver_payload to deliver_payloads;
ALTER TABLE nodes ADD COLUMN node_type text;
ALTER TABLE nodes ALTER COLUMN node_type SET DEFAULT 'leaf';
UPDATE nodes SET node_type = 'leaf';
ALTER TABLE nodes ALTER COLUMN node_type SET NOT NULL;
ALTER TABLE nodes ADD CHECK (node_type IN ('leaf', 'collection'));
ALTER TABLE nodes ALTER COLUMN persistent DROP NOT NULL;
ALTER TABLE nodes ALTER COLUMN persistent DROP DEFAULT;

ALTER TABLE subscriptions RENAME id TO subscription_id;
ALTER TABLE subscriptions RENAME subscription TO state;
ALTER TABLE subscriptions ADD COLUMN subscription_type text
    	CHECK (subscription_type IN (NULL, 'items', 'nodes'));
ALTER TABLE subscriptions ADD COLUMN subscription_depth text
    	CHECK (subscription_depth IN (NULL, '1', 'all'));

INSERT INTO nodes (node, node_type) values ('', 'collection');