aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-20 15:00:13 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-20 15:00:13 +0000
commit219a96bc529a4d77aa0ea661904cc46a7a961883 (patch)
treea38216071fbadc708c6c5b834a0948bfdc396284
parent28739d80e27d9b871c3805cfcd24c8065b543228 (diff)
downloadelgg-219a96bc529a4d77aa0ea661904cc46a7a961883.tar.gz
elgg-219a96bc529a4d77aa0ea661904cc46a7a961883.tar.bz2
Refs #569, #570, #571: Update script for both users and plugins plugin settings
git-svn-id: https://code.elgg.org/elgg/trunk@2477 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/schema/upgrades/2008112001.sql2
-rw-r--r--engine/schema/upgrades/2008112002.sql29
-rw-r--r--version.php2
3 files changed, 31 insertions, 2 deletions
diff --git a/engine/schema/upgrades/2008112001.sql b/engine/schema/upgrades/2008112001.sql
index b17e30a1e..9159e6c6f 100644
--- a/engine/schema/upgrades/2008112001.sql
+++ b/engine/schema/upgrades/2008112001.sql
@@ -21,4 +21,4 @@ CREATE TEMPORARY TABLE __upgrade_2008112001_1 (
DELETE FROM `prefix_metadata` WHERE id in (SELECT id from __upgrade_2008112001_1);
---DROP TABLE __upgrade_2008112001_1; \ No newline at end of file
+DROP TABLE __upgrade_2008112001_1; \ No newline at end of file
diff --git a/engine/schema/upgrades/2008112002.sql b/engine/schema/upgrades/2008112002.sql
new file mode 100644
index 000000000..31b3cc6eb
--- /dev/null
+++ b/engine/schema/upgrades/2008112002.sql
@@ -0,0 +1,29 @@
+-- Move user plugins settings to new data store
+INSERT INTO `prefix_private_settings` (entity_guid, name, `value`)
+ SELECT e.guid as guid, name_string.string as name, value_string.string as value FROM `prefix_entities` e
+ JOIN `prefix_metadata` name_val ON e.guid=name_val.entity_guid
+ JOIN `prefix_metastrings` name_string ON name_val.name_id = name_string.id
+ JOIN `prefix_metastrings` value_string ON name_val.value_id = value_string.id
+ WHERE
+ e.type='user' AND
+ name_string.string like 'plugin:settings:%';
+
+-- Delete previous settings
+CREATE TEMPORARY TABLE __upgrade_2008112002_1 (
+ SELECT distinct meta.id as id from `prefix_metadata meta`
+ JOIN `prefix_private_settings` settings ON meta.entity_guid = settings.entity_guid
+
+ JOIN `prefix_entities` e ON e.guid = meta.entity_guid
+ JOIN `prefix_metadata` name_val ON e.guid=name_val.entity_guid
+
+ JOIN `prefix_metastrings` name_string ON name_val.name_id = name_string.id
+ JOIN `prefix_metastrings` value_string ON name_val.value_id = value_string.id
+ WHERE
+ e.type='user' AND
+ name_string.string like 'plugin:settings:%' AND
+ meta.name_id = name_string.id
+);
+
+DELETE FROM `prefix_metadata` WHERE id in (SELECT id from __upgrade_2008112002_1);
+
+DROP TABLE __upgrade_2008112002_1; \ No newline at end of file
diff --git a/version.php b/version.php
index af610ee9f..d7184d437 100644
--- a/version.php
+++ b/version.php
@@ -13,7 +13,7 @@
* @link http://elgg.org/
*/
- $version = 2008112001; // YYYYMMDD = Elgg Date
+ $version = 2008112002; // YYYYMMDD = Elgg Date
// XX = Interim incrementer
$release = '1.1'; // Human-friendly version name