[CalendarServer-changes] [15397] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Dec 15 10:19:54 PST 2015


Revision: 15397
          http://trac.calendarserver.org//changeset/15397
Author:   cdaboo at apple.com
Date:     2015-12-15 10:19:54 -0800 (Tue, 15 Dec 2015)
Log Message:
-----------
Better schema comparisons. Manual schema upgrade for IS&T.

Modified Paths:
--------------
    CalendarServer/trunk/requirements-cs.txt
    CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_47_to_48.sql
    CalendarServer/trunk/txdav/common/datastore/test/test_sql_schema_files.py
    CalendarServer/trunk/txdav/common/datastore/upgrade/sql/test/test_upgrade.py

Added Paths:
-----------
    CalendarServer/trunk/txdav/common/datastore/sql_schema/manual_upgrades/
    CalendarServer/trunk/txdav/common/datastore/sql_schema/manual_upgrades/oracle_to_28.sql

Modified: CalendarServer/trunk/requirements-cs.txt
===================================================================
--- CalendarServer/trunk/requirements-cs.txt	2015-12-15 17:14:26 UTC (rev 15396)
+++ CalendarServer/trunk/requirements-cs.txt	2015-12-15 18:19:54 UTC (rev 15397)
@@ -7,7 +7,7 @@
     zope.interface==4.1.3
 	    setuptools==18.5
 
-    --editable svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@15391#egg=twextpy
+    --editable svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@15396#egg=twextpy
         cffi==1.3.0
             pycparser==2.14
         #twisted

Added: CalendarServer/trunk/txdav/common/datastore/sql_schema/manual_upgrades/oracle_to_28.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql_schema/manual_upgrades/oracle_to_28.sql	                        (rev 0)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/manual_upgrades/oracle_to_28.sql	2015-12-15 18:19:54 UTC (rev 15397)
@@ -0,0 +1,36 @@
+----
+-- Copyright (c) 2015 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 at VERSION 28 --
+-------------------------------------------
+
+-- Missing index rename
+alter index ADDRESSBOOK_OBJECT_RE_40cc2d73 rename to ADDRESSBOOK_OBJECT_RE_2bfcf757;
+
+-- Missing index
+create index IMIP_TOKENS_TOKEN_e94b918f on IMIP_TOKENS (
+    TOKEN
+);
+
+alter table PUSH_NOTIFICATION_WORK
+    modify ("PRIORITY" integer default null);
+
+alter table CALENDAR_HOME
+    modify ("DATAVERSION" integer default 0 not null);
+
+alter table ADDRESSBOOK_HOME
+    modify ("DATAVERSION" integer default 0 not null);

Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_47_to_48.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_47_to_48.sql	2015-12-15 17:14:26 UTC (rev 15396)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_47_to_48.sql	2015-12-15 18:19:54 UTC (rev 15397)
@@ -31,7 +31,7 @@
 
 -- Add unique to ADDRESSBOOK_OBJECT_REVISIONS and remove old index
 --Not for IS&T: alter table ADDRESSBOOK_OBJECT_REVISIONS add unique (ADDRESSBOOK_HOME_RESOURCE_ID, OWNER_HOME_RESOURCE_ID, ADDRESSBOOK_NAME, RESOURCE_NAME);
-drop index ADDRESSBOOK_OBJECT_RE_40cc2d73; -- Name of index changed for IS&T
+drop index ADDRESSBOOK_OBJECT_RE_2bfcf757;
 
 
 -- update the version

Modified: CalendarServer/trunk/txdav/common/datastore/test/test_sql_schema_files.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/test_sql_schema_files.py	2015-12-15 17:14:26 UTC (rev 15396)
+++ CalendarServer/trunk/txdav/common/datastore/test/test_sql_schema_files.py	2015-12-15 18:19:54 UTC (rev 15397)
@@ -136,7 +136,7 @@
         v6Schema = schemaFromPath(sqlSchema.child("old").child("postgres-dialect").child("v6.sql"))
         v5Schema = schemaFromPath(sqlSchema.child("old").child("postgres-dialect").child("v5.sql"))
         mismatched = v6Schema.compare(v5Schema)
-        self.assertEqual(len(mismatched), 4, msg="\n".join(mismatched))
+        self.assertEqual(len(mismatched), 5, msg="\n".join(mismatched))
 
 
     def test_references_index(self):

Modified: CalendarServer/trunk/txdav/common/datastore/upgrade/sql/test/test_upgrade.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/upgrade/sql/test/test_upgrade.py	2015-12-15 17:14:26 UTC (rev 15396)
+++ CalendarServer/trunk/txdav/common/datastore/upgrade/sql/test/test_upgrade.py	2015-12-15 18:19:54 UTC (rev 15397)
@@ -238,6 +238,8 @@
                 mismatched.remove(i)
             except ValueError:
                 pass
+        if mismatched and mismatched[0].startswith("Comparing schema: current.sql to Upgraded from"):
+            del mismatched[0]
         self.assertEqual(len(mismatched), 0, "Schema mismatch:\n" + "\n".join(mismatched))
 
         yield _unloadOldSchema()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151215/f25b14fd/attachment-0001.html>


More information about the calendarserver-changes mailing list