[CalendarServer-changes] [12146] CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/ oracle-dialect/upgrade_from_29_to_30.sql

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:19:23 PDT 2014


Revision: 12146
          http://trac.calendarserver.org//changeset/12146
Author:   gaya at apple.com
Date:     2013-12-19 11:16:40 -0800 (Thu, 19 Dec 2013)
Log Message:
-----------
fix constraint drops

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_29_to_30.sql

Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_29_to_30.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_29_to_30.sql	2013-12-19 19:10:14 UTC (rev 12145)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_29_to_30.sql	2013-12-19 19:16:40 UTC (rev 12146)
@@ -22,18 +22,21 @@
 -- Change Address Book Object Members --
 ----------------------------------------
 
+begin
+for i in (select constraint_name from abo_members where column_name = 'MEMBER_ID' or column_name = 'GROUP_ID')
+loop
+execute immediate 'alter table abo_members constraint' || i.constraint_name;
+end loop;
+end;
+
 alter table ABO_MEMBERS
-	drop ("abo_members_member_id_fkey");
-alter table ABO_MEMBERS
-	drop ("abo_members_group_id_fkey");
-alter table ABO_MEMBERS
 	add ("REVISION" integer default nextval('REVISION_SEQ') not null);
 alter table ABO_MEMBERS
 	add ("REMOVED" boolean default false not null);
 alter table ABO_MEMBERS
-	 drop ("abo_members_pkey");
+	 drop primary key;
 alter table ABO_MEMBERS
-	 add ("abo_members_pkey" primary key ("GROUP_ID", "MEMBER_ID", "REVISION"));
+	 add primary key ("GROUP_ID", "MEMBER_ID", "REVISION");
 
 ------------------------------------------
 -- Change Address Book Object Revisions --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/82b85fb3/attachment.html>


More information about the calendarserver-changes mailing list