[CalendarServer-changes] [15676] CalendarServer/trunk/txdav/common/datastore/sql_schema

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 15 15:32:47 PDT 2016


Revision: 15676
          http://trac.calendarserver.org//changeset/15676
Author:   sagen at apple.com
Date:     2016-06-15 15:32:47 -0700 (Wed, 15 Jun 2016)
Log Message:
-----------
Add index for CALENDAR_OBJECT.ORIGINAL_COLLECTION

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

Added Paths:
-----------
    CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_62_to_63.sql
    CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_62_to_63.sql

Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/current-oracle-dialect.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql_schema/current-oracle-dialect.sql	2016-06-15 17:31:19 UTC (rev 15675)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/current-oracle-dialect.sql	2016-06-15 22:32:47 UTC (rev 15676)
@@ -680,7 +680,7 @@
     "VALUE" nvarchar2(255)
 );
 
-insert into CALENDARSERVER (NAME, VALUE) values ('VERSION', '62');
+insert into CALENDARSERVER (NAME, VALUE) values ('VERSION', '63');
 insert into CALENDARSERVER (NAME, VALUE) values ('CALENDAR-DATAVERSION', '6');
 insert into CALENDARSERVER (NAME, VALUE) values ('ADDRESSBOOK-DATAVERSION', '2');
 insert into CALENDARSERVER (NAME, VALUE) values ('NOTIFICATION-DATAVERSION', '1');
@@ -750,6 +750,10 @@
     "DROPBOX_ID"
 );
 
+create index CALENDAR_OBJECT_ORIGI_a3d15cf2 on CALENDAR_OBJECT (
+    "ORIGINAL_COLLECTION"
+);
+
 create index TIME_RANGE_CALENDAR_R_beb6e7eb on TIME_RANGE (
     "CALENDAR_RESOURCE_ID"
 );

Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/current.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql_schema/current.sql	2016-06-15 17:31:19 UTC (rev 15675)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/current.sql	2016-06-15 22:32:47 UTC (rev 15676)
@@ -67,7 +67,7 @@
   OWNER_UID        varchar(255) not null,                		                -- implicit index
   STATUS           integer      default 0 not null,                             -- enum HOME_STATUS
   DATAVERSION      integer      default 0 not null,
-  
+
   unique (OWNER_UID, STATUS)	-- implicit index
 );
 
@@ -159,7 +159,7 @@
   REMOTE_RESOURCE_ID			integer not null,
   LOCAL_RESOURCE_ID				integer	references CALENDAR on delete cascade,
   LAST_SYNC_TOKEN				varchar(255),
-   
+
   primary key (CALENDAR_HOME_RESOURCE_ID, REMOTE_RESOURCE_ID) -- implicit index
 );
 
@@ -176,7 +176,7 @@
   OWNER_UID   varchar(255) not null,	                                   -- implicit index
   STATUS      integer      default 0 not null,                             -- enum HOME_STATUS
   DATAVERSION integer      default 0 not null,
-    
+
   unique (OWNER_UID, STATUS)	-- implicit index
 );
 
@@ -316,6 +316,9 @@
 create index CALENDAR_OBJECT_DROPBOX_ID on
   CALENDAR_OBJECT(DROPBOX_ID);
 
+create index CALENDAR_OBJECT_ORIGINAL_COLLECTION on
+  CALENDAR_OBJECT(ORIGINAL_COLLECTION);
+
 -- Enumeration of attachment modes
 
 create table CALENDAR_OBJ_ATTACHMENTS_MODE (
@@ -407,7 +410,7 @@
   CALENDAR_HOME_RESOURCE_ID		integer references CALENDAR_HOME on delete cascade,
   REMOTE_RESOURCE_ID			integer not null,
   LOCAL_RESOURCE_ID				integer	references CALENDAR_OBJECT on delete cascade,
-   
+
   primary key (CALENDAR_HOME_RESOURCE_ID, REMOTE_RESOURCE_ID) -- implicit index
 );
 
@@ -462,7 +465,7 @@
   CALENDAR_HOME_RESOURCE_ID		integer references CALENDAR_HOME on delete cascade,
   REMOTE_RESOURCE_ID			integer not null,
   LOCAL_RESOURCE_ID				integer	references ATTACHMENT on delete cascade,
-   
+
   primary key (CALENDAR_HOME_RESOURCE_ID, REMOTE_RESOURCE_ID) -- implicit index
 );
 
@@ -496,7 +499,7 @@
   OWNER_UID                     varchar(255)    not null,
   STATUS                        integer         default 0 not null,                             -- enum HOME_STATUS
   DATAVERSION                   integer         default 0 not null,
-    
+
   unique (OWNER_UID, STATUS)	-- implicit index
 );
 
@@ -1072,7 +1075,7 @@
   JOB_ID                        integer      references JOB not null,
   HOME_ID                       integer      not null references CALENDAR_HOME on delete cascade,
   RESOURCE_NAME                 varchar(255) not null,
-  
+
   unique (HOME_ID, RESOURCE_NAME)    -- implicit index
 );
 
@@ -1310,7 +1313,7 @@
   VALUE                         varchar(255)
 );
 
-insert into CALENDARSERVER values ('VERSION', '62');
+insert into CALENDARSERVER values ('VERSION', '63');
 insert into CALENDARSERVER values ('CALENDAR-DATAVERSION', '6');
 insert into CALENDARSERVER values ('ADDRESSBOOK-DATAVERSION', '2');
 insert into CALENDARSERVER values ('NOTIFICATION-DATAVERSION', '1');

Added: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_62_to_63.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_62_to_63.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_62_to_63.sql	2016-06-15 22:32:47 UTC (rev 15676)
@@ -0,0 +1,26 @@
+----
+-- Copyright (c) 2012-2016 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
+---------------------------------------------------
+-- Upgrade database schema from VERSION 62 to 63 --
+---------------------------------------------------
+
+create index CALENDAR_OBJECT_ORIGI_a3d15cf2 on CALENDAR_OBJECT (
+    "ORIGINAL_COLLECTION"
+);
+
+-- update the version
+update CALENDARSERVER set VALUE = '63' where NAME = 'VERSION';

Added: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_62_to_63.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_62_to_63.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_62_to_63.sql	2016-06-15 22:32:47 UTC (rev 15676)
@@ -0,0 +1,25 @@
+----
+-- Copyright (c) 2012-2016 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
+---------------------------------------------------
+-- Upgrade database schema from VERSION 62 to 63 --
+---------------------------------------------------
+
+create index CALENDAR_OBJECT_ORIGINAL_COLLECTION on
+  CALENDAR_OBJECT(ORIGINAL_COLLECTION);
+
+-- update the version
+update CALENDARSERVER set VALUE = '63' where NAME = 'VERSION';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160615/95ab2121/attachment.html>


More information about the calendarserver-changes mailing list