From 31ebb648e128396c1e7974677fc6eaf354c1b1b9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 27 Feb 2007 12:34:45 +0000 Subject: - Patch #103634 by chriskennedy: variable.name only 48 charachters. --- modules/system/system.install | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/system/system.install b/modules/system/system.install index 44ecdde6d..fb35dcc6b 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -571,7 +571,7 @@ function system_install() { ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); db_query("CREATE TABLE {variable} ( - name varchar(48) NOT NULL default '', + name varchar(128) NOT NULL default '', value longtext NOT NULL, PRIMARY KEY (name) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); @@ -1047,7 +1047,7 @@ function system_install() { )"); db_query("CREATE TABLE {variable} ( - name varchar(48) NOT NULL default '', + name varchar(128) NOT NULL default '', value text NOT NULL, PRIMARY KEY (name) )"); @@ -3578,6 +3578,23 @@ function system_update_2001() { return $ret; } +/** + * Increase the maximum length of variable names from 48 to 128. + */ +function system_update_2002() { + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'pgsql': + db_change_column($ret, 'variable', 'name', 'name', 'varchar(128)', array('not null' => TRUE, 'default' => "''")); + break; + case 'mysql': + case 'mysqli': + $ret[] = update_sql("ALTER TABLE {variable} CHANGE name name varchar(128) NOT NULL default ''"); + break; + } + return $ret; +} + /** * @} End of "defgroup updates-5.0-to-x.x" * The next series of updates should start at 3000. -- cgit v1.2.3