Revision 3733,
1.7 KB
checked in by gabriel.malheiros, 14 years ago
(diff) |
Ticket #1541 - <Davical customizado para o Expresso.Utiliza Caldav e CardDav?>
|
Line | |
---|
1 | |
---|
2 | -- This database update refines the constraint on usr in order to try and be |
---|
3 | -- able to actually DELETE FROM usr WHERE user_no = x; and have the database |
---|
4 | -- do the right thing... |
---|
5 | |
---|
6 | BEGIN; |
---|
7 | SELECT check_db_revision(1,2,4); |
---|
8 | |
---|
9 | ALTER TABLE calendar_item DROP CONSTRAINT "calendar_item_user_no_fkey"; |
---|
10 | ALTER TABLE calendar_item ADD CONSTRAINT "calendar_item_user_no_fkey" FOREIGN KEY (user_no) REFERENCES usr(user_no) |
---|
11 | ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE; |
---|
12 | |
---|
13 | ALTER TABLE caldav_data DROP CONSTRAINT "caldav_data_logged_user_fkey"; |
---|
14 | ALTER TABLE caldav_data ADD CONSTRAINT "caldav_data_logged_user_fkey" FOREIGN KEY (logged_user) REFERENCES usr(user_no) |
---|
15 | ON UPDATE CASCADE ON DELETE SET DEFAULT DEFERRABLE; |
---|
16 | |
---|
17 | ALTER TABLE relationship DROP CONSTRAINT "relationship_from_user_fkey"; |
---|
18 | ALTER TABLE relationship ADD CONSTRAINT "relationship_from_user_fkey" FOREIGN KEY (from_user) REFERENCES usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE; |
---|
19 | ALTER TABLE relationship DROP CONSTRAINT "relationship_to_user_fkey"; |
---|
20 | ALTER TABLE relationship ADD CONSTRAINT "relationship_to_user_fkey" FOREIGN KEY (to_user) REFERENCES usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE; |
---|
21 | ALTER TABLE relationship DROP CONSTRAINT "relationship_rt_id_fkey"; |
---|
22 | ALTER TABLE relationship ADD CONSTRAINT "relationship_rt_id_fkey" FOREIGN KEY (rt_id) REFERENCES relationship_type(rt_id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE; |
---|
23 | |
---|
24 | ALTER TABLE property DROP CONSTRAINT "property_changed_by_fkey"; |
---|
25 | ALTER TABLE property ADD CONSTRAINT "property_changed_by_fkey" FOREIGN KEY (changed_by) REFERENCES usr(user_no) |
---|
26 | ON UPDATE CASCADE ON DELETE SET DEFAULT DEFERRABLE; |
---|
27 | |
---|
28 | |
---|
29 | SELECT new_db_revision(1,2,5, 'Mai' ); |
---|
30 | |
---|
31 | COMMIT; |
---|
32 | ROLLBACK; |
---|
33 | |
---|
Note: See
TracBrowser
for help on using the repository browser.