index : flyspray | |
Archlinux32 customized Flyspray installation | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-01 09:05:48 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-01 09:05:48 +0100 |
commit | 6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch) | |
tree | 350feb504587d932e02837a1442b059759927646 /setup/upgrade/1.0/varchartotext.php |
-rw-r--r-- | setup/upgrade/1.0/varchartotext.php | 17 |
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'); +} +?> |