[CalendarServer-changes] [11846] CalendarServer/branches/release/CalendarServer-5.1-dev/txdav/common /datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_13_to_14.sql
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:23:13 PDT 2014
Revision: 11846
http://trac.calendarserver.org//changeset/11846
Author: cdaboo at apple.com
Date: 2013-10-30 09:42:16 -0700 (Wed, 30 Oct 2013)
Log Message:
-----------
Make sure null values are removed from columns we are about to constrain as not null.
Modified Paths:
--------------
CalendarServer/branches/release/CalendarServer-5.1-dev/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_13_to_14.sql
Modified: CalendarServer/branches/release/CalendarServer-5.1-dev/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_13_to_14.sql
===================================================================
--- CalendarServer/branches/release/CalendarServer-5.1-dev/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_13_to_14.sql 2013-10-30 00:05:49 UTC (rev 11845)
+++ CalendarServer/branches/release/CalendarServer-5.1-dev/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_13_to_14.sql 2013-10-30 16:42:16 UTC (rev 11846)
@@ -26,6 +26,11 @@
drop column SEEN_BY_OWNER;
alter table CALENDAR_BIND
drop column SEEN_BY_SHAREE;
+
+-- Don't allow nulls in the column we are about to constrain
+update CALENDAR_BIND
+ set CALENDAR_RESOURCE_NAME = 'Shared_' || CALENDAR_RESOURCE_ID || '_' || CALENDAR_HOME_RESOURCE_ID
+ where CALENDAR_RESOURCE_NAME is null;
alter table CALENDAR_BIND
alter column CALENDAR_RESOURCE_NAME
set not null;
@@ -34,6 +39,11 @@
drop column SEEN_BY_OWNER;
alter table ADDRESSBOOK_BIND
drop column SEEN_BY_SHAREE;
+
+-- Don't allow nulls in the column we are about to constrain
+update ADDRESSBOOK_BIND
+ set ADDRESSBOOK_RESOURCE_NAME = 'Shared_' || ADDRESSBOOK_RESOURCE_ID || '_' || ADDRESSBOOK_HOME_RESOURCE_ID
+ where ADDRESSBOOK_RESOURCE_NAME is null;
alter table ADDRESSBOOK_BIND
alter column ADDRESSBOOK_RESOURCE_NAME
set not null;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/73711ba8/attachment.html>
More information about the calendarserver-changes
mailing list