[Pkg-owncloud-commits] [php-sabredav] 103/220: Repairing the components field if it was NULL before.

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 42ef94ace5cda790d19b232aeba58bc42c9a6656
Author: Evert Pot <me at evertpot.com>
Date:   Wed Mar 23 01:49:09 2016 -0400

    Repairing the components field if it was NULL before.
---
 bin/migrateto32.php | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/migrateto32.php b/bin/migrateto32.php
index 8cebf12..15859ca 100755
--- a/bin/migrateto32.php
+++ b/bin/migrateto32.php
@@ -81,19 +81,19 @@ switch ($driver) {
         die(-1);
 }
 
-echo "Creating 'calendar_instances'\n";
+echo "Creating 'calendarinstances'\n";
 $addValueType = false;
 try {
-    $result = $pdo->query('SELECT * FROM calendar_instances LIMIT 1');
+    $result = $pdo->query('SELECT * FROM calendarinstances LIMIT 1');
     $result->fetch(\PDO::FETCH_ASSOC);
-    echo "calendar_instances exists. Assuming this part of the migration has already been done.\n";
+    echo "calendarinstances exists. Assuming this part of the migration has already been done.\n";
 } catch (Exception $e) {
-    echo "calendar_instances does not yet exist. Creating table and migrating data.\n";
+    echo "calendarinstances does not yet exist. Creating table and migrating data.\n";
 
     switch ($driver) {
         case 'mysql' :
             $pdo->exec(<<<SQL
-CREATE TABLE calendar_instances (
+CREATE TABLE calendarinstances (
     id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
     calendarid INTEGER UNSIGNED NOT NULL,
     principaluri VARBINARY(100),
@@ -110,7 +110,7 @@ CREATE TABLE calendar_instances (
 SQL
         );
             $pdo->exec("
-INSERT INTO calendar_instances
+INSERT INTO calendarinstances
     (
         calendarid,
         principaluri,
@@ -153,7 +153,7 @@ CREATE TABLE calendarinstances (
 SQL
         );
             $pdo->exec("
-INSERT INTO calendar_instances
+INSERT INTO calendarinstances
     (
         calendarid,
         principaluri,
@@ -247,7 +247,7 @@ SQL
     echo "Migrating data from old to new table\n";
 
     $pdo->exec(<<<SQL
-INSERT INTO calendars (id, synctoken, components) SELECT id, synctoken, components FROM $calendarBackup
+INSERT INTO calendars (id, synctoken, components) SELECT id, synctoken, COALESCE(components,"VEVENT,VTODO,VJOURNAL") as components FROM $calendarBackup
 SQL
     );
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-php/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list