<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12232] CalendarServer/trunk/txdav/common/datastore/sql_schema</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12232">12232</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-01-03 12:06:54 -0800 (Fri, 03 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Back port the previous sql index addition to an early DB version to match that on an active branch.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv27sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v27.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv28sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v28.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv29sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v29.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv30sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v30.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv31sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v31.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv27sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v27.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv28sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v28.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv29sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v29.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv30sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v30.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv31sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v31.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_26_to_27sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_26_to_27.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_27_to_28sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_27_to_28.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_28_to_29sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_28_to_29.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_29_to_30sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_29_to_30.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_30_to_31sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_30_to_31.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_31_to_32sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_31_to_32.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_26_to_27sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_26_to_27.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_27_to_28sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_27_to_28.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_28_to_29sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_28_to_29.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_29_to_30sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_29_to_30.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_30_to_31sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_30_to_31.sql</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_31_to_32sql">CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_31_to_32.sql</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv27sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v27.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v27.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v27.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx">     &quot;QUOTA_USED_BYTES&quot; integer default 0 not null,
</span><span class="cx">     &quot;DEFAULT_EVENTS&quot; integer default null references CALENDAR on delete set null,
</span><span class="cx">     &quot;DEFAULT_TASKS&quot; integer default null references CALENDAR on delete set null,
</span><del>-    &quot;DEFAULT_POLLS&quot; integer default null references CALENDAR on delete set null,
</del><span class="cx">     &quot;ALARM_VEVENT_TIMED&quot; nclob default null,
</span><span class="cx">     &quot;ALARM_VEVENT_ALLDAY&quot; nclob default null,
</span><span class="cx">     &quot;ALARM_VTODO_TIMED&quot; nclob default null,
</span><span class="lines">@@ -377,10 +376,6 @@
</span><span class="cx">     DEFAULT_TASKS
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>-create index CALENDAR_HOME_METADAT_910264ce on CALENDAR_HOME_METADATA (
-    DEFAULT_POLLS
-);
-
</del><span class="cx"> create index NOTIFICATION_NOTIFICA_f891f5f9 on NOTIFICATION (
</span><span class="cx">     NOTIFICATION_HOME_RESOURCE_ID
</span><span class="cx"> );
</span><span class="lines">@@ -423,6 +418,10 @@
</span><span class="cx">     CALENDAR_HOME_RESOURCE_ID
</span><span class="cx"> );
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID_5073cf23 on ATTACHMENT (
+    DROPBOX_ID
+);
+
</ins><span class="cx"> create index ATTACHMENT_CALENDAR_O_81508484 on ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">     CALENDAR_OBJECT_RESOURCE_ID
</span><span class="cx"> );
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv28sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v28.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v28.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v28.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -347,8 +347,7 @@
</span><span class="cx"> create table PUSH_NOTIFICATION_WORK (
</span><span class="cx">     &quot;WORK_ID&quot; integer primary key not null,
</span><span class="cx">     &quot;NOT_BEFORE&quot; timestamp default CURRENT_TIMESTAMP at time zone 'UTC',
</span><del>-    &quot;PUSH_ID&quot; nvarchar2(255),
-    &quot;PRIORITY&quot; integer not null
</del><ins>+    &quot;PUSH_ID&quot; nvarchar2(255)
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> create table GROUP_CACHER_POLLING_WORK (
</span><span class="lines">@@ -424,6 +423,10 @@
</span><span class="cx">     CALENDAR_HOME_RESOURCE_ID
</span><span class="cx"> );
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID_5073cf23 on ATTACHMENT (
+    DROPBOX_ID
+);
+
</ins><span class="cx"> create index ATTACHMENT_CALENDAR_O_81508484 on ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">     CALENDAR_OBJECT_RESOURCE_ID
</span><span class="cx"> );
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv29sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v29.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v29.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v29.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -49,16 +49,15 @@
</span><span class="cx"> 
</span><span class="cx"> create table NOTIFICATION_HOME (
</span><span class="cx">     &quot;RESOURCE_ID&quot; integer primary key,
</span><del>-    &quot;OWNER_UID&quot; nvarchar2(255) unique,
-    &quot;DATAVERSION&quot; integer default 0 not null
</del><ins>+    &quot;OWNER_UID&quot; nvarchar2(255) unique
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> create table NOTIFICATION (
</span><span class="cx">     &quot;RESOURCE_ID&quot; integer primary key,
</span><span class="cx">     &quot;NOTIFICATION_HOME_RESOURCE_ID&quot; integer not null references NOTIFICATION_HOME,
</span><span class="cx">     &quot;NOTIFICATION_UID&quot; nvarchar2(255),
</span><del>-    &quot;NOTIFICATION_TYPE&quot; nvarchar2(255),
-    &quot;NOTIFICATION_DATA&quot; nclob,
</del><ins>+    &quot;XML_TYPE&quot; nvarchar2(255),
+    &quot;XML_DATA&quot; nclob,
</ins><span class="cx">     &quot;MD5&quot; nchar(32),
</span><span class="cx">     &quot;CREATED&quot; timestamp default CURRENT_TIMESTAMP at time zone 'UTC',
</span><span class="cx">     &quot;MODIFIED&quot; timestamp default CURRENT_TIMESTAMP at time zone 'UTC', 
</span><span class="lines">@@ -92,7 +91,6 @@
</span><span class="cx"> insert into CALENDAR_BIND_MODE (DESCRIPTION, ID) values ('read', 1);
</span><span class="cx"> insert into CALENDAR_BIND_MODE (DESCRIPTION, ID) values ('write', 2);
</span><span class="cx"> insert into CALENDAR_BIND_MODE (DESCRIPTION, ID) values ('direct', 3);
</span><del>-insert into CALENDAR_BIND_MODE (DESCRIPTION, ID) values ('indirect', 4);
</del><span class="cx"> create table CALENDAR_BIND_STATUS (
</span><span class="cx">     &quot;ID&quot; integer primary key,
</span><span class="cx">     &quot;DESCRIPTION&quot; nvarchar2(16) unique
</span><span class="lines">@@ -102,7 +100,6 @@
</span><span class="cx"> insert into CALENDAR_BIND_STATUS (DESCRIPTION, ID) values ('accepted', 1);
</span><span class="cx"> insert into CALENDAR_BIND_STATUS (DESCRIPTION, ID) values ('declined', 2);
</span><span class="cx"> insert into CALENDAR_BIND_STATUS (DESCRIPTION, ID) values ('invalid', 3);
</span><del>-insert into CALENDAR_BIND_STATUS (DESCRIPTION, ID) values ('deleted', 4);
</del><span class="cx"> create table CALENDAR_TRANSP (
</span><span class="cx">     &quot;ID&quot; integer primary key,
</span><span class="cx">     &quot;DESCRIPTION&quot; nvarchar2(16) unique
</span><span class="lines">@@ -373,7 +370,6 @@
</span><span class="cx"> insert into CALENDARSERVER (NAME, VALUE) values ('VERSION', '29');
</span><span class="cx"> insert into CALENDARSERVER (NAME, VALUE) values ('CALENDAR-DATAVERSION', '5');
</span><span class="cx"> insert into CALENDARSERVER (NAME, VALUE) values ('ADDRESSBOOK-DATAVERSION', '2');
</span><del>-insert into CALENDARSERVER (NAME, VALUE) values ('NOTIFICATION-DATAVERSION', '1');
</del><span class="cx"> create index CALENDAR_HOME_METADAT_3cb9049e on CALENDAR_HOME_METADATA (
</span><span class="cx">     DEFAULT_EVENTS
</span><span class="cx"> );
</span><span class="lines">@@ -428,6 +424,10 @@
</span><span class="cx">     CALENDAR_HOME_RESOURCE_ID
</span><span class="cx"> );
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID_5073cf23 on ATTACHMENT (
+    DROPBOX_ID
+);
+
</ins><span class="cx"> create index ATTACHMENT_CALENDAR_O_81508484 on ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">     CALENDAR_OBJECT_RESOURCE_ID
</span><span class="cx"> );
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv30sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v30.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v30.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v30.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -256,12 +256,10 @@
</span><span class="cx"> insert into ADDRESSBOOK_OBJECT_KIND (DESCRIPTION, ID) values ('resource', 2);
</span><span class="cx"> insert into ADDRESSBOOK_OBJECT_KIND (DESCRIPTION, ID) values ('location', 3);
</span><span class="cx"> create table ABO_MEMBERS (
</span><del>-    &quot;GROUP_ID&quot; integer not null,
</del><ins>+    &quot;GROUP_ID&quot; integer not null references ADDRESSBOOK_OBJECT on delete cascade,
</ins><span class="cx">     &quot;ADDRESSBOOK_ID&quot; integer not null references ADDRESSBOOK_HOME on delete cascade,
</span><del>-    &quot;MEMBER_ID&quot; integer not null,
-    &quot;REVISION&quot; integer not null,
-    &quot;REMOVED&quot; integer default 0 not null, 
-    primary key(&quot;GROUP_ID&quot;, &quot;MEMBER_ID&quot;, &quot;REVISION&quot;)
</del><ins>+    &quot;MEMBER_ID&quot; integer not null references ADDRESSBOOK_OBJECT, 
+    primary key(&quot;GROUP_ID&quot;, &quot;MEMBER_ID&quot;)
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> create table ABO_FOREIGN_MEMBERS (
</span><span class="lines">@@ -296,7 +294,6 @@
</span><span class="cx">     &quot;ADDRESSBOOK_HOME_RESOURCE_ID&quot; integer not null references ADDRESSBOOK_HOME,
</span><span class="cx">     &quot;OWNER_HOME_RESOURCE_ID&quot; integer references ADDRESSBOOK_HOME,
</span><span class="cx">     &quot;ADDRESSBOOK_NAME&quot; nvarchar2(255) default null,
</span><del>-    &quot;OBJECT_RESOURCE_ID&quot; integer default 0,
</del><span class="cx">     &quot;RESOURCE_NAME&quot; nvarchar2(255),
</span><span class="cx">     &quot;REVISION&quot; integer not null,
</span><span class="cx">     &quot;DELETED&quot; integer not null
</span><span class="lines">@@ -431,6 +428,10 @@
</span><span class="cx">     CALENDAR_HOME_RESOURCE_ID
</span><span class="cx"> );
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID_5073cf23 on ATTACHMENT (
+    DROPBOX_ID
+);
+
</ins><span class="cx"> create index ATTACHMENT_CALENDAR_O_81508484 on ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">     CALENDAR_OBJECT_RESOURCE_ID
</span><span class="cx"> );
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldoracledialectv31sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v31.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v31.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/oracle-dialect/v31.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,17 +18,9 @@
</span><span class="cx"> create table CALENDAR_HOME (
</span><span class="cx">     &quot;RESOURCE_ID&quot; integer primary key,
</span><span class="cx">     &quot;OWNER_UID&quot; nvarchar2(255) unique,
</span><del>-    &quot;STATUS&quot; integer default 0 not null,
</del><span class="cx">     &quot;DATAVERSION&quot; integer default 0 not null
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>-create table HOME_STATUS (
-    &quot;ID&quot; integer primary key,
-    &quot;DESCRIPTION&quot; nvarchar2(16) unique
-);
-
-insert into HOME_STATUS (DESCRIPTION, ID) values ('normal', 0);
-insert into HOME_STATUS (DESCRIPTION, ID) values ('external', 1);
</del><span class="cx"> create table CALENDAR (
</span><span class="cx">     &quot;RESOURCE_ID&quot; integer primary key
</span><span class="cx"> );
</span><span class="lines">@@ -58,7 +50,6 @@
</span><span class="cx"> create table NOTIFICATION_HOME (
</span><span class="cx">     &quot;RESOURCE_ID&quot; integer primary key,
</span><span class="cx">     &quot;OWNER_UID&quot; nvarchar2(255) unique,
</span><del>-    &quot;STATUS&quot; integer default 0 not null,
</del><span class="cx">     &quot;DATAVERSION&quot; integer default 0 not null
</span><span class="cx"> );
</span><span class="cx"> 
</span><span class="lines">@@ -77,7 +68,6 @@
</span><span class="cx"> create table CALENDAR_BIND (
</span><span class="cx">     &quot;CALENDAR_HOME_RESOURCE_ID&quot; integer not null references CALENDAR_HOME,
</span><span class="cx">     &quot;CALENDAR_RESOURCE_ID&quot; integer not null references CALENDAR on delete cascade,
</span><del>-    &quot;EXTERNAL_ID&quot; integer default null,
</del><span class="cx">     &quot;CALENDAR_RESOURCE_NAME&quot; nvarchar2(255),
</span><span class="cx">     &quot;BIND_MODE&quot; integer not null,
</span><span class="cx">     &quot;BIND_STATUS&quot; integer not null,
</span><span class="lines">@@ -220,7 +210,6 @@
</span><span class="cx">     &quot;RESOURCE_ID&quot; integer primary key,
</span><span class="cx">     &quot;ADDRESSBOOK_PROPERTY_STORE_ID&quot; integer not null,
</span><span class="cx">     &quot;OWNER_UID&quot; nvarchar2(255) unique,
</span><del>-    &quot;STATUS&quot; integer default 0 not null,
</del><span class="cx">     &quot;DATAVERSION&quot; integer default 0 not null
</span><span class="cx"> );
</span><span class="cx"> 
</span><span class="lines">@@ -234,7 +223,6 @@
</span><span class="cx"> create table SHARED_ADDRESSBOOK_BIND (
</span><span class="cx">     &quot;ADDRESSBOOK_HOME_RESOURCE_ID&quot; integer not null references ADDRESSBOOK_HOME,
</span><span class="cx">     &quot;OWNER_HOME_RESOURCE_ID&quot; integer not null references ADDRESSBOOK_HOME on delete cascade,
</span><del>-    &quot;EXTERNAL_ID&quot; integer default null,
</del><span class="cx">     &quot;ADDRESSBOOK_RESOURCE_NAME&quot; nvarchar2(255),
</span><span class="cx">     &quot;BIND_MODE&quot; integer not null,
</span><span class="cx">     &quot;BIND_STATUS&quot; integer not null,
</span><span class="lines">@@ -286,7 +274,6 @@
</span><span class="cx"> create table SHARED_GROUP_BIND (
</span><span class="cx">     &quot;ADDRESSBOOK_HOME_RESOURCE_ID&quot; integer not null references ADDRESSBOOK_HOME,
</span><span class="cx">     &quot;GROUP_RESOURCE_ID&quot; integer not null references ADDRESSBOOK_OBJECT on delete cascade,
</span><del>-    &quot;EXTERNAL_ID&quot; integer default null,
</del><span class="cx">     &quot;GROUP_ADDRESSBOOK_NAME&quot; nvarchar2(255),
</span><span class="cx">     &quot;BIND_MODE&quot; integer not null,
</span><span class="cx">     &quot;BIND_STATUS&quot; integer not null,
</span><span class="lines">@@ -444,6 +431,10 @@
</span><span class="cx">     CALENDAR_HOME_RESOURCE_ID
</span><span class="cx"> );
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID_5073cf23 on ATTACHMENT (
+    DROPBOX_ID
+);
+
</ins><span class="cx"> create index ATTACHMENT_CALENDAR_O_81508484 on ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">     CALENDAR_OBJECT_RESOURCE_ID
</span><span class="cx"> );
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv27sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v27.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v27.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v27.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx">   QUOTA_USED_BYTES         integer     default 0 not null,
</span><span class="cx">   DEFAULT_EVENTS           integer     default null references CALENDAR on delete set null,
</span><span class="cx">   DEFAULT_TASKS            integer     default null references CALENDAR on delete set null,
</span><del>-  DEFAULT_POLLS            integer     default null references CALENDAR on delete set null,
</del><span class="cx">   ALARM_VEVENT_TIMED       text        default null,
</span><span class="cx">   ALARM_VEVENT_ALLDAY      text        default null,
</span><span class="cx">   ALARM_VTODO_TIMED        text        default null,
</span><span class="lines">@@ -88,8 +87,6 @@
</span><span class="cx">         CALENDAR_HOME_METADATA(DEFAULT_EVENTS);
</span><span class="cx"> create index CALENDAR_HOME_METADATA_DEFAULT_TASKS on
</span><span class="cx">         CALENDAR_HOME_METADATA(DEFAULT_TASKS);
</span><del>-create index CALENDAR_HOME_METADATA_DEFAULT_POLLS on
-        CALENDAR_HOME_METADATA(DEFAULT_POLLS);
</del><span class="cx"> 
</span><span class="cx"> -----------------------
</span><span class="cx"> -- Calendar Metadata --
</span><span class="lines">@@ -342,6 +339,9 @@
</span><span class="cx"> create index ATTACHMENT_CALENDAR_HOME_RESOURCE_ID on
</span><span class="cx">   ATTACHMENT(CALENDAR_HOME_RESOURCE_ID);
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID on
+  ATTACHMENT(DROPBOX_ID);
+
</ins><span class="cx"> -- Many-to-many relationship between attachments and calendar objects
</span><span class="cx"> create table ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">   ATTACHMENT_ID                  integer      not null references ATTACHMENT on delete cascade,
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv28sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v28.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v28.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v28.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -342,6 +342,9 @@
</span><span class="cx"> create index ATTACHMENT_CALENDAR_HOME_RESOURCE_ID on
</span><span class="cx">   ATTACHMENT(CALENDAR_HOME_RESOURCE_ID);
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID on
+  ATTACHMENT(DROPBOX_ID);
+
</ins><span class="cx"> -- Many-to-many relationship between attachments and calendar objects
</span><span class="cx"> create table ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">   ATTACHMENT_ID                  integer      not null references ATTACHMENT on delete cascade,
</span><span class="lines">@@ -663,8 +666,7 @@
</span><span class="cx"> create table PUSH_NOTIFICATION_WORK (
</span><span class="cx">   WORK_ID                       integer      primary key default nextval('WORKITEM_SEQ') not null, -- implicit index
</span><span class="cx">   NOT_BEFORE                    timestamp    default timezone('UTC', CURRENT_TIMESTAMP),
</span><del>-  PUSH_ID                       varchar(255) not null,
-  PRIORITY                      integer      not null -- 1:low 5:medium 10:high
</del><ins>+  PUSH_ID                       varchar(255) not null
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> -----------------
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv29sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v29.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v29.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v29.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -109,16 +109,15 @@
</span><span class="cx"> 
</span><span class="cx"> create table NOTIFICATION_HOME (
</span><span class="cx">   RESOURCE_ID integer      primary key default nextval('RESOURCE_ID_SEQ'), -- implicit index
</span><del>-  OWNER_UID   varchar(255) not null unique,                                -- implicit index
-  DATAVERSION integer      default 0 not null
</del><ins>+  OWNER_UID   varchar(255) not null unique                                 -- implicit index
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> create table NOTIFICATION (
</span><span class="cx">   RESOURCE_ID                   integer      primary key default nextval('RESOURCE_ID_SEQ'), -- implicit index
</span><span class="cx">   NOTIFICATION_HOME_RESOURCE_ID integer      not null references NOTIFICATION_HOME,
</span><span class="cx">   NOTIFICATION_UID              varchar(255) not null,
</span><del>-  NOTIFICATION_TYPE             varchar(255) not null,
-  NOTIFICATION_DATA             text         not null,
</del><ins>+  XML_TYPE                      varchar(255) not null,
+  XML_DATA                      text         not null,
</ins><span class="cx">   MD5                           char(32)     not null,
</span><span class="cx">   CREATED                       timestamp    default timezone('UTC', CURRENT_TIMESTAMP),
</span><span class="cx">   MODIFIED                      timestamp    default timezone('UTC', CURRENT_TIMESTAMP),
</span><span class="lines">@@ -169,7 +168,6 @@
</span><span class="cx"> insert into CALENDAR_BIND_MODE values (1, 'read' );
</span><span class="cx"> insert into CALENDAR_BIND_MODE values (2, 'write');
</span><span class="cx"> insert into CALENDAR_BIND_MODE values (3, 'direct');
</span><del>-insert into CALENDAR_BIND_MODE values (4, 'indirect');
</del><span class="cx"> 
</span><span class="cx"> -- Enumeration of statuses
</span><span class="cx"> 
</span><span class="lines">@@ -182,7 +180,6 @@
</span><span class="cx"> insert into CALENDAR_BIND_STATUS values (1, 'accepted');
</span><span class="cx"> insert into CALENDAR_BIND_STATUS values (2, 'declined');
</span><span class="cx"> insert into CALENDAR_BIND_STATUS values (3, 'invalid');
</span><del>-insert into CALENDAR_BIND_STATUS values (4, 'deleted');
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> -- Enumeration of transparency
</span><span class="lines">@@ -345,6 +342,9 @@
</span><span class="cx"> create index ATTACHMENT_CALENDAR_HOME_RESOURCE_ID on
</span><span class="cx">   ATTACHMENT(CALENDAR_HOME_RESOURCE_ID);
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID on
+  ATTACHMENT(DROPBOX_ID);
+
</ins><span class="cx"> -- Many-to-many relationship between attachments and calendar objects
</span><span class="cx"> create table ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">   ATTACHMENT_ID                  integer      not null references ATTACHMENT on delete cascade,
</span><span class="lines">@@ -705,4 +705,3 @@
</span><span class="cx"> insert into CALENDARSERVER values ('VERSION', '29');
</span><span class="cx"> insert into CALENDARSERVER values ('CALENDAR-DATAVERSION', '5');
</span><span class="cx"> insert into CALENDARSERVER values ('ADDRESSBOOK-DATAVERSION', '2');
</span><del>-insert into CALENDARSERVER values ('NOTIFICATION-DATAVERSION', '1');
</del></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv30sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v30.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v30.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v30.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -345,6 +345,9 @@
</span><span class="cx"> create index ATTACHMENT_CALENDAR_HOME_RESOURCE_ID on
</span><span class="cx">   ATTACHMENT(CALENDAR_HOME_RESOURCE_ID);
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID on
+  ATTACHMENT(DROPBOX_ID);
+
</ins><span class="cx"> -- Many-to-many relationship between attachments and calendar objects
</span><span class="cx"> create table ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">   ATTACHMENT_ID                  integer      not null references ATTACHMENT on delete cascade,
</span><span class="lines">@@ -454,24 +457,16 @@
</span><span class="cx"> insert into ADDRESSBOOK_OBJECT_KIND values (3, 'location');
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-----------------------------------
--- Revisions, forward reference --
-----------------------------------
-
-create sequence REVISION_SEQ;
-
</del><span class="cx"> ---------------------------------
</span><span class="cx"> -- Address Book Object Members --
</span><span class="cx"> ---------------------------------
</span><span class="cx"> 
</span><span class="cx"> create table ABO_MEMBERS (
</span><del>-    GROUP_ID              integer      not null, -- references ADDRESSBOOK_OBJECT on delete cascade,        -- AddressBook Object's (kind=='group') RESOURCE_ID
</del><ins>+    GROUP_ID              integer      not null references ADDRESSBOOK_OBJECT on delete cascade,        -- AddressBook Object's (kind=='group') RESOURCE_ID
</ins><span class="cx">          ADDRESSBOOK_ID                  integer      not null references ADDRESSBOOK_HOME on delete cascade,
</span><del>-    MEMBER_ID             integer      not null, -- references ADDRESSBOOK_OBJECT,                                                -- member AddressBook Object's RESOURCE_ID
-          REVISION              integer      default nextval('REVISION_SEQ') not null,
-          REMOVED               boolean      default false not null,
</del><ins>+    MEMBER_ID             integer      not null references ADDRESSBOOK_OBJECT,                                                -- member AddressBook Object's RESOURCE_ID
</ins><span class="cx"> 
</span><del>-    primary key (GROUP_ID, MEMBER_ID, REVISION) -- implicit index
</del><ins>+    primary key (GROUP_ID, MEMBER_ID) -- implicit index
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> create index ABO_MEMBERS_ADDRESSBOOK_ID on
</span><span class="lines">@@ -510,7 +505,7 @@
</span><span class="cx">   MESSAGE                                      text,                  -- FIXME: xml?
</span><span class="cx"> 
</span><span class="cx">   primary key (ADDRESSBOOK_HOME_RESOURCE_ID, GROUP_RESOURCE_ID), -- implicit index
</span><del>-  unique (ADDRESSBOOK_HOME_RESOURCE_ID, GROUP_ADDRESSBOOK_NAME)  -- implicit index
</del><ins>+  unique (ADDRESSBOOK_HOME_RESOURCE_ID, GROUP_ADDRESSBOOK_NAME)     -- implicit index
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> create index SHARED_GROUP_BIND_RESOURCE_ID on
</span><span class="lines">@@ -521,7 +516,7 @@
</span><span class="cx"> -- Revisions --
</span><span class="cx"> ---------------
</span><span class="cx"> 
</span><del>--- create sequence REVISION_SEQ;
</del><ins>+create sequence REVISION_SEQ;
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> -------------------------------
</span><span class="lines">@@ -555,7 +550,6 @@
</span><span class="cx">   ADDRESSBOOK_HOME_RESOURCE_ID                         integer                        not null references ADDRESSBOOK_HOME,
</span><span class="cx">   OWNER_HOME_RESOURCE_ID                            integer             references ADDRESSBOOK_HOME,
</span><span class="cx">   ADDRESSBOOK_NAME                                     varchar(255)         default null,
</span><del>-  OBJECT_RESOURCE_ID                                        integer                        default 0,
</del><span class="cx">   RESOURCE_NAME                                        varchar(255),
</span><span class="cx">   REVISION                                             integer             default nextval('REVISION_SEQ') not null,
</span><span class="cx">   DELETED                                              boolean              not null
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaoldpostgresdialectv31sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v31.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v31.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/old/postgres-dialect/v31.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -53,22 +53,10 @@
</span><span class="cx"> 
</span><span class="cx"> create table CALENDAR_HOME (
</span><span class="cx">   RESOURCE_ID      integer      primary key default nextval('RESOURCE_ID_SEQ'), -- implicit index
</span><del>-  OWNER_UID        varchar(255) not null unique,                                -- implicit index
-  STATUS           integer      default 0 not null,                             -- enum HOME_STATUS
</del><ins>+  OWNER_UID        varchar(255) not null unique,                                 -- implicit index
</ins><span class="cx">   DATAVERSION      integer      default 0 not null
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>--- Enumeration of statuses
-
-create table HOME_STATUS (
-  ID          integer     primary key,
-  DESCRIPTION varchar(16) not null unique
-);
-
-insert into HOME_STATUS values (0, 'normal' );
-insert into HOME_STATUS values (1, 'external');
-
-
</del><span class="cx"> --------------
</span><span class="cx"> -- Calendar --
</span><span class="cx"> --------------
</span><span class="lines">@@ -77,7 +65,6 @@
</span><span class="cx">   RESOURCE_ID integer   primary key default nextval('RESOURCE_ID_SEQ') -- implicit index
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> ----------------------------
</span><span class="cx"> -- Calendar Home Metadata --
</span><span class="cx"> ----------------------------
</span><span class="lines">@@ -104,7 +91,6 @@
</span><span class="cx"> create index CALENDAR_HOME_METADATA_DEFAULT_POLLS on
</span><span class="cx">         CALENDAR_HOME_METADATA(DEFAULT_POLLS);
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> -----------------------
</span><span class="cx"> -- Calendar Metadata --
</span><span class="cx"> -----------------------
</span><span class="lines">@@ -124,7 +110,6 @@
</span><span class="cx"> create table NOTIFICATION_HOME (
</span><span class="cx">   RESOURCE_ID integer      primary key default nextval('RESOURCE_ID_SEQ'), -- implicit index
</span><span class="cx">   OWNER_UID   varchar(255) not null unique,                                -- implicit index
</span><del>-  STATUS      integer      default 0 not null,                             -- enum HOME_STATUS
</del><span class="cx">   DATAVERSION integer      default 0 not null
</span><span class="cx"> );
</span><span class="cx"> 
</span><span class="lines">@@ -154,7 +139,6 @@
</span><span class="cx"> create table CALENDAR_BIND (
</span><span class="cx">   CALENDAR_HOME_RESOURCE_ID integer      not null references CALENDAR_HOME,
</span><span class="cx">   CALENDAR_RESOURCE_ID      integer      not null references CALENDAR on delete cascade,
</span><del>-  EXTERNAL_ID                            integer      default null,
</del><span class="cx">   CALENDAR_RESOURCE_NAME    varchar(255) not null,
</span><span class="cx">   BIND_MODE                 integer      not null, -- enum CALENDAR_BIND_MODE
</span><span class="cx">   BIND_STATUS               integer      not null, -- enum CALENDAR_BIND_STATUS
</span><span class="lines">@@ -361,6 +345,9 @@
</span><span class="cx"> create index ATTACHMENT_CALENDAR_HOME_RESOURCE_ID on
</span><span class="cx">   ATTACHMENT(CALENDAR_HOME_RESOURCE_ID);
</span><span class="cx"> 
</span><ins>+create index ATTACHMENT_DROPBOX_ID on
+  ATTACHMENT(DROPBOX_ID);
+
</ins><span class="cx"> -- Many-to-many relationship between attachments and calendar objects
</span><span class="cx"> create table ATTACHMENT_CALENDAR_OBJECT (
</span><span class="cx">   ATTACHMENT_ID                  integer      not null references ATTACHMENT on delete cascade,
</span><span class="lines">@@ -396,7 +383,6 @@
</span><span class="cx">   RESOURCE_ID                                      integer                        primary key default nextval('RESOURCE_ID_SEQ'), -- implicit index
</span><span class="cx">   ADDRESSBOOK_PROPERTY_STORE_ID        integer              default nextval('RESOURCE_ID_SEQ') not null,         -- implicit index
</span><span class="cx">   OWNER_UID                                        varchar(255)         not null unique,                                -- implicit index
</span><del>-  STATUS                                           integer              default 0 not null,                             -- enum HOME_STATUS
</del><span class="cx">   DATAVERSION                                      integer              default 0 not null
</span><span class="cx"> );
</span><span class="cx"> 
</span><span class="lines">@@ -422,7 +408,6 @@
</span><span class="cx"> create table SHARED_ADDRESSBOOK_BIND (
</span><span class="cx">   ADDRESSBOOK_HOME_RESOURCE_ID                        integer                        not null references ADDRESSBOOK_HOME,
</span><span class="cx">   OWNER_HOME_RESOURCE_ID                            integer              not null references ADDRESSBOOK_HOME on delete cascade,
</span><del>-  EXTERNAL_ID                                        integer         default null,
</del><span class="cx">   ADDRESSBOOK_RESOURCE_NAME                            varchar(255)         not null,
</span><span class="cx">   BIND_MODE                                            integer              not null,        -- enum CALENDAR_BIND_MODE
</span><span class="cx">   BIND_STATUS                                          integer              not null,        -- enum CALENDAR_BIND_STATUS
</span><span class="lines">@@ -521,7 +506,6 @@
</span><span class="cx"> create table SHARED_GROUP_BIND (        
</span><span class="cx">   ADDRESSBOOK_HOME_RESOURCE_ID                 integer      not null references ADDRESSBOOK_HOME,
</span><span class="cx">   GROUP_RESOURCE_ID                              integer      not null references ADDRESSBOOK_OBJECT on delete cascade,
</span><del>-  EXTERNAL_ID                                    integer      default null,
</del><span class="cx">   GROUP_ADDRESSBOOK_NAME                        varchar(255) not null,
</span><span class="cx">   BIND_MODE                                    integer      not null, -- enum CALENDAR_BIND_MODE
</span><span class="cx">   BIND_STATUS                                  integer      not null, -- enum CALENDAR_BIND_STATUS
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_26_to_27sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_26_to_27.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_26_to_27.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_26_to_27.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,13 +18,10 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 26 to 27 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- Calendar home related updates
</del><ins>+-- New index
</ins><span class="cx"> 
</span><del>-alter table CALENDAR_HOME_METADATA
- add (&quot;DEFAULT_POLLS&quot; integer default null references CALENDAR on delete set null);
-
-create index CALENDAR_HOME_METADAT_910264ce on CALENDAR_HOME_METADATA (
-    DEFAULT_POLLS
</del><ins>+create index ATTACHMENT_DROPBOX_ID_5073cf23 on ATTACHMENT (
+    DROPBOX_ID
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_27_to_28sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_27_to_28.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_27_to_28.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_27_to_28.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,12 +18,16 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 27 to 28 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- Push notification work related updates
</del><ins>+-- Calendar home related updates
</ins><span class="cx"> 
</span><del>-alter table PUSH_NOTIFICATION_WORK
- add (&quot;PRIORITY&quot; integer default 10 not null);
</del><ins>+alter table CALENDAR_HOME_METADATA
+ add (&quot;DEFAULT_POLLS&quot; integer default null references CALENDAR on delete set null);
</ins><span class="cx"> 
</span><del>-update PUSH_NOTIFICATION_WORK set PRIORITY = 10;
</del><ins>+create index CALENDAR_HOME_METADAT_910264ce on CALENDAR_HOME_METADATA (
+    DEFAULT_POLLS
+);
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> -- Now update the version
</span><ins>+-- No data upgrades
</ins><span class="cx"> update CALENDARSERVER set VALUE = '28' where NAME = 'VERSION';
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_28_to_29sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_28_to_29.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_28_to_29.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_28_to_29.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,21 +18,12 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 28 to 29 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- Sharing notification related updates
</del><ins>+-- Push notification work related updates
</ins><span class="cx"> 
</span><del>-alter table NOTIFICATION_HOME
- add (&quot;DATAVERSION&quot; integer default 0 not null);
</del><ins>+alter table PUSH_NOTIFICATION_WORK
+ add (&quot;PRIORITY&quot; integer default 10 not null);
</ins><span class="cx"> 
</span><del>-alter table NOTIFICATION
-  rename column XML_TYPE to NOTIFICATION_TYPE;
-alter table NOTIFICATION
-  rename column XML_DATA to NOTIFICATION_DATA;
</del><ins>+update PUSH_NOTIFICATION_WORK set PRIORITY = 10;
</ins><span class="cx"> 
</span><del>-  -- Sharing enumeration updates
-insert into CALENDAR_BIND_MODE (DESCRIPTION, ID) values ('indirect', 4);
-
-insert into CALENDAR_BIND_STATUS (DESCRIPTION, ID) values ('deleted', 4);
-
</del><span class="cx"> -- Now update the version
</span><span class="cx"> update CALENDARSERVER set VALUE = '29' where NAME = 'VERSION';
</span><del>-insert into CALENDARSERVER (NAME, VALUE) values ('NOTIFICATION-DATAVERSION', '1');
</del></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_29_to_30sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_29_to_30.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_29_to_30.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_29_to_30.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,35 +18,21 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 29 to 30 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>-----------------------------------------
--- Change Address Book Object Members --
-----------------------------------------
</del><ins>+-- Sharing notification related updates
</ins><span class="cx"> 
</span><del>-begin
-for i in (select constraint_name from user_cons_columns where column_name = 'MEMBER_ID' or column_name = 'GROUP_ID')
-loop
-execute immediate 'alter table abo_members drop constraint' || i.constraint_name;
-end loop;
-end;
</del><ins>+alter table NOTIFICATION_HOME
+ add (&quot;DATAVERSION&quot; integer default 0 not null);
</ins><span class="cx"> 
</span><del>-alter table ABO_MEMBERS
-        add (&quot;REVISION&quot; integer default nextval('REVISION_SEQ') not null);
-alter table ABO_MEMBERS
-        add (&quot;REMOVED&quot; boolean default false not null);
-alter table ABO_MEMBERS
-         drop primary key;
-alter table ABO_MEMBERS
-         add primary key (&quot;GROUP_ID&quot;, &quot;MEMBER_ID&quot;, &quot;REVISION&quot;);
</del><ins>+alter table NOTIFICATION
+  rename column XML_TYPE to NOTIFICATION_TYPE;
+alter table NOTIFICATION
+  rename column XML_DATA to NOTIFICATION_DATA;
</ins><span class="cx"> 
</span><del>-------------------------------------------
--- Change Address Book Object Revisions --
-------------------------------------------
-        
-alter table ADDRESSBOOK_OBJECT_REVISIONS
-        add (&quot;OBJECT_RESOURCE_ID&quot; integer default 0);
</del><ins>+  -- Sharing enumeration updates
+insert into CALENDAR_BIND_MODE (DESCRIPTION, ID) values ('indirect', 4);
</ins><span class="cx"> 
</span><del>---------------------
--- Update version --
---------------------
</del><ins>+insert into CALENDAR_BIND_STATUS (DESCRIPTION, ID) values ('deleted', 4);
</ins><span class="cx"> 
</span><ins>+-- Now update the version
</ins><span class="cx"> update CALENDARSERVER set VALUE = '30' where NAME = 'VERSION';
</span><ins>+insert into CALENDARSERVER (NAME, VALUE) values ('NOTIFICATION-DATAVERSION', '1');
</ins></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_30_to_31sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_30_to_31.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_30_to_31.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_30_to_31.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,36 +18,35 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 30 to 31 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- Home related updates
</del><ins>+----------------------------------------
+-- Change Address Book Object Members --
+----------------------------------------
</ins><span class="cx"> 
</span><del>-alter table CALENDAR_HOME
- add (&quot;STATUS&quot; integer default 0 not null);
</del><ins>+begin
+for i in (select constraint_name from user_cons_columns where column_name = 'MEMBER_ID' or column_name = 'GROUP_ID')
+loop
+execute immediate 'alter table abo_members drop constraint' || i.constraint_name;
+end loop;
+end;
</ins><span class="cx"> 
</span><del>-alter table NOTIFICATION_HOME
- add (&quot;STATUS&quot; integer default 0 not null);
</del><ins>+alter table ABO_MEMBERS
+        add (&quot;REVISION&quot; integer default nextval('REVISION_SEQ') not null);
+alter table ABO_MEMBERS
+        add (&quot;REMOVED&quot; boolean default false not null);
+alter table ABO_MEMBERS
+         drop primary key;
+alter table ABO_MEMBERS
+         add primary key (&quot;GROUP_ID&quot;, &quot;MEMBER_ID&quot;, &quot;REVISION&quot;);
</ins><span class="cx"> 
</span><del>-alter table ADDRESSBOOK_HOME
- add (&quot;STATUS&quot; integer default 0 not null);
</del><ins>+------------------------------------------
+-- Change Address Book Object Revisions --
+------------------------------------------
+        
+alter table ADDRESSBOOK_OBJECT_REVISIONS
+        add (&quot;OBJECT_RESOURCE_ID&quot; integer default 0);
</ins><span class="cx"> 
</span><del>-create table HOME_STATUS (
-    &quot;ID&quot; integer primary key,
-    &quot;DESCRIPTION&quot; nvarchar2(16) unique
-);
</del><ins>+--------------------
+-- Update version --
+--------------------
</ins><span class="cx"> 
</span><del>-insert into HOME_STATUS (DESCRIPTION, ID) values ('normal', 0);
-insert into HOME_STATUS (DESCRIPTION, ID) values ('external', 1);
-
--- Bind changes
-alter table CALENDAR_BIND
- add (&quot;EXTERNAL_ID&quot; integer default null);
-
-alter table SHARED_ADDRESSBOOK_BIND
- add (&quot;EXTERNAL_ID&quot; integer default null);
-
-alter table SHARED_GROUP_BIND
- add (&quot;EXTERNAL_ID&quot; integer default null);
-
-
--- Now update the version
--- No data upgrades
</del><span class="cx"> update CALENDARSERVER set VALUE = '31' where NAME = 'VERSION';
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradesoracledialectupgrade_from_31_to_32sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_31_to_32.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_31_to_32.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/oracle-dialect/upgrade_from_31_to_32.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,13 +18,36 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 31 to 32 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- New index
</del><ins>+-- Home related updates
</ins><span class="cx"> 
</span><del>-create index ATTACHMENT_DROPBOX_ID_5073cf23 on ATTACHMENT (
-    DROPBOX_ID
</del><ins>+alter table CALENDAR_HOME
+ add (&quot;STATUS&quot; integer default 0 not null);
+
+alter table NOTIFICATION_HOME
+ add (&quot;STATUS&quot; integer default 0 not null);
+
+alter table ADDRESSBOOK_HOME
+ add (&quot;STATUS&quot; integer default 0 not null);
+
+create table HOME_STATUS (
+    &quot;ID&quot; integer primary key,
+    &quot;DESCRIPTION&quot; nvarchar2(16) unique
</ins><span class="cx"> );
</span><span class="cx"> 
</span><ins>+insert into HOME_STATUS (DESCRIPTION, ID) values ('normal', 0);
+insert into HOME_STATUS (DESCRIPTION, ID) values ('external', 1);
</ins><span class="cx"> 
</span><ins>+-- Bind changes
+alter table CALENDAR_BIND
+ add (&quot;EXTERNAL_ID&quot; integer default null);
+
+alter table SHARED_ADDRESSBOOK_BIND
+ add (&quot;EXTERNAL_ID&quot; integer default null);
+
+alter table SHARED_GROUP_BIND
+ add (&quot;EXTERNAL_ID&quot; integer default null);
+
+
</ins><span class="cx"> -- Now update the version
</span><span class="cx"> -- No data upgrades
</span><span class="cx"> update CALENDARSERVER set VALUE = '32' where NAME = 'VERSION';
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_26_to_27sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_26_to_27.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_26_to_27.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_26_to_27.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,13 +18,11 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 26 to 27 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- Calendar home related updates
</del><ins>+-- New index
</ins><span class="cx"> 
</span><del>-alter table CALENDAR_HOME_METADATA
- add column DEFAULT_POLLS integer default null references CALENDAR on delete set null;
</del><ins>+create index ATTACHMENT_DROPBOX_ID on
+  ATTACHMENT(DROPBOX_ID);
</ins><span class="cx"> 
</span><del>-create index CALENDAR_HOME_METADATA_DEFAULT_POLLS on
-        CALENDAR_HOME_METADATA(DEFAULT_POLLS);
</del><span class="cx"> 
</span><span class="cx"> -- Now update the version
</span><span class="cx"> -- No data upgrades
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_27_to_28sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_27_to_28.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_27_to_28.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_27_to_28.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,12 +18,14 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 27 to 28 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- Push notification work related updates
</del><ins>+-- Calendar home related updates
</ins><span class="cx"> 
</span><del>-alter table PUSH_NOTIFICATION_WORK
- add column PRIORITY integer default 10 not null;
</del><ins>+alter table CALENDAR_HOME_METADATA
+ add column DEFAULT_POLLS integer default null references CALENDAR on delete set null;
</ins><span class="cx"> 
</span><del>-update PUSH_NOTIFICATION_WORK set PRIORITY = 10;
</del><ins>+create index CALENDAR_HOME_METADATA_DEFAULT_POLLS on
+        CALENDAR_HOME_METADATA(DEFAULT_POLLS);
</ins><span class="cx"> 
</span><span class="cx"> -- Now update the version
</span><ins>+-- No data upgrades
</ins><span class="cx"> update CALENDARSERVER set VALUE = '28' where NAME = 'VERSION';
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_28_to_29sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_28_to_29.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_28_to_29.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_28_to_29.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,21 +18,12 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 28 to 29 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- Sharing notification related updates
</del><ins>+-- Push notification work related updates
</ins><span class="cx"> 
</span><del>-alter table NOTIFICATION_HOME
-  add column DATAVERSION integer default 0 not null;
</del><ins>+alter table PUSH_NOTIFICATION_WORK
+ add column PRIORITY integer default 10 not null;
</ins><span class="cx"> 
</span><del>-alter table NOTIFICATION
-  rename column XML_TYPE to NOTIFICATION_TYPE;
-alter table NOTIFICATION
-  rename column XML_DATA to NOTIFICATION_DATA;
</del><ins>+update PUSH_NOTIFICATION_WORK set PRIORITY = 10;
</ins><span class="cx"> 
</span><del>--- Sharing enumeration updates
-insert into CALENDAR_BIND_MODE values (4, 'indirect');
-
-insert into CALENDAR_BIND_STATUS values (4, 'deleted');
-
</del><span class="cx"> -- Now update the version
</span><span class="cx"> update CALENDARSERVER set VALUE = '29' where NAME = 'VERSION';
</span><del>-insert into CALENDARSERVER values ('NOTIFICATION-DATAVERSION', '1');
</del></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_29_to_30sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_29_to_30.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_29_to_30.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_29_to_30.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,27 +18,21 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 29 to 30 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>-----------------------------------------
--- Change Address Book Object Members --
-----------------------------------------
</del><ins>+-- Sharing notification related updates
</ins><span class="cx"> 
</span><del>-alter table ABO_MEMBERS
-        drop constraint        abo_members_member_id_fkey,
-        drop constraint        abo_members_group_id_fkey,
-        add column        REVISION                integer      default nextval('REVISION_SEQ') not null,
-        add column        REMOVED         boolean      default false not null,
-        drop constraint abo_members_pkey,
-        add constraint abo_members_pkey primary key(GROUP_ID, MEMBER_ID, REVISION);
</del><ins>+alter table NOTIFICATION_HOME
+  add column DATAVERSION integer default 0 not null;
</ins><span class="cx"> 
</span><del>-------------------------------------------
--- Change Address Book Object Revisions --
-------------------------------------------
-        
-alter table ADDRESSBOOK_OBJECT_REVISIONS
-        add column OBJECT_RESOURCE_ID integer default 0;
-        
---------------------
--- Update version --
---------------------
</del><ins>+alter table NOTIFICATION
+  rename column XML_TYPE to NOTIFICATION_TYPE;
+alter table NOTIFICATION
+  rename column XML_DATA to NOTIFICATION_DATA;
</ins><span class="cx"> 
</span><ins>+-- Sharing enumeration updates
+insert into CALENDAR_BIND_MODE values (4, 'indirect');
+
+insert into CALENDAR_BIND_STATUS values (4, 'deleted');
+
+-- Now update the version
</ins><span class="cx"> update CALENDARSERVER set VALUE = '30' where NAME = 'VERSION';
</span><ins>+insert into CALENDARSERVER values ('NOTIFICATION-DATAVERSION', '1');
</ins></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_30_to_31sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_30_to_31.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_30_to_31.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_30_to_31.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,38 +18,27 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 30 to 31 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- Home related updates
</del><ins>+----------------------------------------
+-- Change Address Book Object Members --
+----------------------------------------
</ins><span class="cx"> 
</span><del>-alter table CALENDAR_HOME
- add column STATUS integer default 0 not null;
</del><ins>+alter table ABO_MEMBERS
+        drop constraint        abo_members_member_id_fkey,
+        drop constraint        abo_members_group_id_fkey,
+        add column        REVISION                integer      default nextval('REVISION_SEQ') not null,
+        add column        REMOVED         boolean      default false not null,
+        drop constraint abo_members_pkey,
+        add constraint abo_members_pkey primary key(GROUP_ID, MEMBER_ID, REVISION);
</ins><span class="cx"> 
</span><del>-alter table NOTIFICATION_HOME
- add column STATUS integer default 0 not null;
</del><ins>+------------------------------------------
+-- Change Address Book Object Revisions --
+------------------------------------------
+        
+alter table ADDRESSBOOK_OBJECT_REVISIONS
+        add column OBJECT_RESOURCE_ID integer default 0;
+        
+--------------------
+-- Update version --
+--------------------
</ins><span class="cx"> 
</span><del>-alter table ADDRESSBOOK_HOME
- add column STATUS integer default 0 not null;
-
--- Enumeration of statuses
-
-create table HOME_STATUS (
-  ID          integer     primary key,
-  DESCRIPTION varchar(16) not null unique
-);
-
-insert into HOME_STATUS values (0, 'normal' );
-insert into HOME_STATUS values (1, 'external');
-
--- Bind changes
-alter table CALENDAR_BIND
- add column EXTERNAL_ID integer default null;
-
-alter table SHARED_ADDRESSBOOK_BIND
- add column EXTERNAL_ID integer default null;
-
-alter table SHARED_GROUP_BIND
- add column EXTERNAL_ID integer default null;
-
-
--- Now update the version
--- No data upgrades
</del><span class="cx"> update CALENDARSERVER set VALUE = '31' where NAME = 'VERSION';
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresql_schemaupgradespostgresdialectupgrade_from_31_to_32sql"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_31_to_32.sql (12231 => 12232)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_31_to_32.sql        2014-01-03 19:57:55 UTC (rev 12231)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema/upgrades/postgres-dialect/upgrade_from_31_to_32.sql        2014-01-03 20:06:54 UTC (rev 12232)
</span><span class="lines">@@ -18,12 +18,38 @@
</span><span class="cx"> -- Upgrade database schema from VERSION 31 to 32 --
</span><span class="cx"> ---------------------------------------------------
</span><span class="cx"> 
</span><del>--- New index
</del><ins>+-- Home related updates
</ins><span class="cx"> 
</span><del>-create index ATTACHMENT_DROPBOX_ID on
-  ATTACHMENT(DROPBOX_ID);
</del><ins>+alter table CALENDAR_HOME
+ add column STATUS integer default 0 not null;
</ins><span class="cx"> 
</span><ins>+alter table NOTIFICATION_HOME
+ add column STATUS integer default 0 not null;
</ins><span class="cx"> 
</span><ins>+alter table ADDRESSBOOK_HOME
+ add column STATUS integer default 0 not null;
+
+-- Enumeration of statuses
+
+create table HOME_STATUS (
+  ID          integer     primary key,
+  DESCRIPTION varchar(16) not null unique
+);
+
+insert into HOME_STATUS values (0, 'normal' );
+insert into HOME_STATUS values (1, 'external');
+
+-- Bind changes
+alter table CALENDAR_BIND
+ add column EXTERNAL_ID integer default null;
+
+alter table SHARED_ADDRESSBOOK_BIND
+ add column EXTERNAL_ID integer default null;
+
+alter table SHARED_GROUP_BIND
+ add column EXTERNAL_ID integer default null;
+
+
</ins><span class="cx"> -- Now update the version
</span><span class="cx"> -- No data upgrades
</span><span class="cx"> update CALENDARSERVER set VALUE = '32' where NAME = 'VERSION';
</span></span></pre>
</div>
</div>

</body>
</html>