[CalendarServer-changes] [11132] CalendarServer/branches/users/gaya/sharedgroups-3/txdav/common/ datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_18_to_19.sql

source_changes at macosforge.org source_changes at macosforge.org
Fri May 3 17:06:41 PDT 2013


Revision: 11132
          http://trac.calendarserver.org//changeset/11132
Author:   gaya at apple.com
Date:     2013-05-03 17:06:40 -0700 (Fri, 03 May 2013)
Log Message:
-----------
Do update minus old addressbook to addressbookhome value update.

Modified Paths:
--------------
    CalendarServer/branches/users/gaya/sharedgroups-3/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_18_to_19.sql

Modified: CalendarServer/branches/users/gaya/sharedgroups-3/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_18_to_19.sql
===================================================================
--- CalendarServer/branches/users/gaya/sharedgroups-3/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_18_to_19.sql	2013-05-04 00:02:14 UTC (rev 11131)
+++ CalendarServer/branches/users/gaya/sharedgroups-3/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_18_to_19.sql	2013-05-04 00:06:40 UTC (rev 11132)
@@ -106,30 +106,53 @@
 
 
 
---------------------
--- Simple Updates --
---------------------
+-----------------------------
+-- Alter  ADDRESSBOOK_HOME --
+-----------------------------
 
 alter table ADDRESSBOOK_HOME
-	add column ADDRESSBOOK_PROPERTY_STORE_ID	integer      	default nextval('RESOURCE_ID_SEQ') not null;
+	add column	ADDRESSBOOK_PROPERTY_STORE_ID	integer	default nextval('RESOURCE_ID_SEQ') not null;
 
+--  could set ADDRESSBOOK_PROPERTY_STORE_ID to addressbook resourceID to save ab properties:  But there are no props worth saving!
+	
 
-------------------
--- TODO: Finish --
-------------------
+-------------------------------
+-- Alter  ADDRESSBOOK_OBJECT --
+-------------------------------
 
+alter table ADDRESSBOOK_OBJECT
+	add column	KIND 	integer  	not null; 	-- enum OBJECT_KIND
+-- KIND values set in addressbook data upgrade
+
+alter table ADDRESSBOOK_OBJECT
+	add column	ADDRESSBOOK_HOME_RESOURCE_ID	integer	not null references ADDRESSBOOK_HOME on delete cascade;
+
+-- TODO: update ADDRESSBOOK_HOME_RESOURCE_ID
+
+alter table ADDRESSBOOK_OBJECT
+	drop column	ADDRESSBOOK_RESOURCE_ID;
+
 	
---------------------------
--- delete unused tables --
---------------------------
+-----------------------------------------
+-- Alter  ADDRESSBOOK_OBJECT_REVISIONS --
+-----------------------------------------
 
+alter table ADDRESSBOOK_OBJECT_REVISIONS
+	add column	OWNER_ADDRESSBOOK_HOME_RESOURCE_ID	integer	not null references ADDRESSBOOK_HOME on delete cascade;
+
+-- TODO: update ADDRESSBOOK_HOME_RESOURCE_ID
+
+alter table ADDRESSBOOK_OBJECT_REVISIONS
+	drop column	ADDRESSBOOK_RESOURCE_ID;
+
+
+-------------------------------------
+-- Drop ADDRESSBOOK related tables --
+-------------------------------------
+
 drop table ADDRESSBOOK_METADATA;
 drop table ADDRESSBOOK_BIND;
 drop table ADDRESSBOOK;
-
--- not needed:
--- drop index ADDRESSBOOK_BIND_RESOURCE_ID;
-
   
--- Now update the version
+-- update schema version
 update CALENDARSERVER set VALUE = '19' where NAME = 'VERSION';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130503/40614736/attachment.html>


More information about the calendarserver-changes mailing list