Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/setup/upgrade/1.0/varchartotext.php
diff options
context:
space:
mode:
Diffstat (limited to 'setup/upgrade/1.0/varchartotext.php')
-rw-r--r--setup/upgrade/1.0/varchartotext.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/setup/upgrade/1.0/varchartotext.php b/setup/upgrade/1.0/varchartotext.php
new file mode 100644
index 0000000..3bba5ea
--- /dev/null
+++ b/setup/upgrade/1.0/varchartotext.php
@@ -0,0 +1,17 @@
+<?php
+if ($conf['database']['dbtype'] == 'pgsql') {
+ $db->query('ALTER TABLE {prefs} ALTER COLUMN pref_value TYPE text');
+ $db->query('ALTER TABLE {prefs} ALTER COLUMN pref_value SET DEFAULT \'\'');
+}
+elseif($db->dbtype=='mysqli' || $db->dbtype=='mysql') {
+ $sinfo=$db->dblink->serverInfo();
+ if(isset($sinfo['version']) && version_compare($sinfo['version'], '5.5.3')>=0 ){
+ $db->query('ALTER TABLE {prefs} CHANGE `pref_value` `pref_value` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL');
+ }else{
+ $db->query('ALTER TABLE {prefs} CHANGE `pref_value` `pref_value` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL');
+ }
+}
+else{
+ $db->query('ALTER TABLE {prefs} CHANGE `pref_value` `pref_value` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL');
+}
+?>