summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-11-20 11:37:05 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-11-20 11:37:05 +0000
commit64ff0984a910e032c73e0a3b4cea7d83bb25e9e6 (patch)
tree63951b80eb444f518c7cd6e943b599faa2435d2b
parent64edd76af3b165083067581bf54007e2aba815f8 (diff)
downloadbrdo-64ff0984a910e032c73e0a3b4cea7d83bb25e9e6.tar.gz
brdo-64ff0984a910e032c73e0a3b4cea7d83bb25e9e6.tar.bz2
#193510 follow up by webernet: restore updates added through the 4.7.x lifecycle, so any 4.7.x version can be updated to 6.x
-rw-r--r--modules/system/system.install91
1 files changed, 91 insertions, 0 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index 197eac8db..611115d13 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -1034,6 +1034,97 @@ function system_schema() {
// Updates for core.
/**
+ * @defgroup updates-4.7.x-extra Extra system updates for 4.7.x
+ * @{
+ */
+
+function system_update_180() {
+ $ret = array();
+
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ $ret[] = update_sql("ALTER TABLE {node} DROP PRIMARY KEY");
+ $ret[] = update_sql("ALTER TABLE {node} ADD PRIMARY KEY (nid, vid)");
+ $ret[] = update_sql("ALTER TABLE {node} ADD UNIQUE (vid)");
+ $ret[] = update_sql("ALTER TABLE {node} ADD INDEX (nid)");
+
+ $ret[] = update_sql("ALTER TABLE {node_counter} CHANGE nid nid INT(10) NOT NULL DEFAULT '0'");
+ break;
+ case 'pgsql':
+ $ret[] = update_sql("ALTER TABLE {node} DROP CONSTRAINT {node}_pkey"); // Change PK
+ $ret[] = update_sql("ALTER TABLE {node} ADD PRIMARY KEY (nid, vid)");
+ $ret[] = update_sql('DROP INDEX {node}_vid_idx'); // Change normal index to UNIQUE index
+ $ret[] = update_sql('CREATE UNIQUE INDEX {node}_vid_idx ON {node}(vid)');
+ $ret[] = update_sql('CREATE INDEX {node}_nid_idx ON {node}(nid)'); // Add index on nid
+ break;
+ }
+
+ return $ret;
+}
+
+function system_update_181() {
+ $ret = array();
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ $ret[] = update_sql("ALTER TABLE {profile_fields} ADD autocomplete TINYINT(1) NOT NULL AFTER visibility ;");
+ break;
+ case 'pgsql':
+ db_add_column($ret, 'profile_fields', 'autocomplete', 'smallint', array('not null' => TRUE, 'default' => 0));
+ break;
+ }
+ return $ret;
+}
+
+/**
+ * The lid field in pgSQL should not be UNIQUE, but an INDEX.
+ */
+function system_update_182() {
+ $ret = array();
+
+ if ($GLOBALS['db_type'] == 'pgsql') {
+ $ret[] = update_sql('ALTER TABLE {locales_target} DROP CONSTRAINT {locales_target}_lid_key');
+ $ret[] = update_sql('CREATE INDEX {locales_target}_lid_idx ON {locales_target} (lid)');
+ }
+
+ return $ret;
+}
+
+/**
+ * Cid matching by MySQL should be case-sensitive.
+ */
+function system_update_183() {
+ $ret = array();
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ $ret[] = update_sql("ALTER TABLE {cache} CHANGE cid cid varchar(255) BINARY NOT NULL default ''");
+ break;
+ }
+ return $ret;
+}
+
+function system_update_184() {
+ $ret = array();
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ $ret[] = update_sql("ALTER TABLE {access} CHANGE aid aid int(10) NOT NULL AUTO_INCREMENT ");
+ $ret[] = update_sql("ALTER TABLE {boxes} CHANGE bid bid int NOT NULL AUTO_INCREMENT ");
+ break;
+ case 'pgsql':
+ // No database update required for PostgreSQL because it already uses big SERIAL numbers.
+ }
+
+ return $ret;
+}
+
+/**
+ * @} End of "defgroup updates-4.7-extra"
+ */
+
+/**
* @defgroup updates-4.7-to-5.0 System updates from 4.7 to 5.0
* @{
*/