From 2bf76c213c1202e105d4cad42cf97d4916f03de1 Mon Sep 17 00:00:00 2001 From: LEDfan Date: Sat, 13 Sep 2014 11:37:46 +0200 Subject: [PATCH] Remove old properties from deleted contacts, which were already deleted but readded --- appinfo/update.php | 8 ++++++++ appinfo/version | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/appinfo/update.php b/appinfo/update.php index 3872060e..0e6953d2 100644 --- a/appinfo/update.php +++ b/appinfo/update.php @@ -42,3 +42,11 @@ if (version_compare($installedVersion, '0.3.0.14', '==')) { $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*contacts_ocu_cards_properties`'); $result = $stmt->execute(array()); } + +if(version_compare($installedVersion, '0.3.0.18', '<')){ + $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*contacts_cards_properties` + WHERE NOT EXISTS(SELECT NULL + FROM `*PREFIX*contacts_cards` + WHERE `*PREFIX*contacts_cards`.id = `*PREFIX*contacts_cards_properties`.contactid)'); + $result = $stmt->execute(array()); +} diff --git a/appinfo/version b/appinfo/version index 2382399e..05c9e3cc 100644 --- a/appinfo/version +++ b/appinfo/version @@ -1 +1 @@ -0.3.0.17 +0.3.0.18