Merge branch 'rscds' of git+ssh://git.catalyst.net.nz/git/public/rscds into rscds

This commit is contained in:
Andrew McMillan 2007-11-03 20:53:04 +13:00
commit 21794ddcea
2 changed files with 19 additions and 3 deletions

16
dba/patches/1.1.11.sql Normal file
View File

@ -0,0 +1,16 @@
-- Sort out accessing calendar entries.
BEGIN;
SELECT check_db_revision(1,1,10);
ALTER TABLE calendar_item DROP CONSTRAINT "$1";
ALTER TABLE calendar_item ADD CONSTRAINT "$1" FOREIGN KEY (user_no) REFERENCES usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE;
ALTER TABLE collection DROP CONSTRAINT "$1";
ALTER TABLE collection ADD CONSTRAINT "$1" FOREIGN KEY (user_no) REFERENCES usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE;
SELECT new_db_revision(1,1,11, 'November' );
COMMIT;
ROLLBACK;

View File

@ -7,7 +7,7 @@
-- The main event. Where we store the things the calendar throws at us.
CREATE TABLE caldav_data (
user_no INT references usr(user_no),
user_no INT references usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE,
dav_name TEXT,
dav_etag TEXT,
created TIMESTAMP WITH TIME ZONE,
@ -69,7 +69,7 @@ GRANT SELECT,INSERT,UPDATE,DELETE ON calendar_item TO general;
-- Something that can look like a filesystem hierarchy where we store stuff
CREATE TABLE collection (
user_no INT references usr(user_no),
user_no INT references usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE,
parent_container TEXT,
dav_name TEXT,
dav_etag TEXT,
@ -142,4 +142,4 @@ CREATE TABLE freebusy_ticket (
GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE freebusy_ticket TO general;
SELECT new_db_revision(1,1,10, 'October' );
SELECT new_db_revision(1,1,11, 'November' );