Commit c3ec6831 authored by Dries's avatar Dries
Browse files

- Patch #18616: allow longer role names.

parent eade0808
......@@ -402,7 +402,7 @@ function system_install() {
db_query("CREATE TABLE {role} (
rid int unsigned NOT NULL auto_increment,
name varchar(32) NOT NULL default '',
name varchar(64) NOT NULL default '',
PRIMARY KEY (rid),
UNIQUE KEY name (name)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
......@@ -867,7 +867,7 @@ function system_install() {
db_query("CREATE TABLE {role} (
rid serial CHECK (rid >= 0),
name varchar(32) NOT NULL default '',
name varchar(64) NOT NULL default '',
PRIMARY KEY (rid),
UNIQUE (name)
)");
......@@ -3403,6 +3403,23 @@ function system_update_1016() {
return $ret;
}
/**
* Allow role names to be up to 64 characters.
*/
function system_update_1017() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'pgsql':
db_change_column($ret, 'role', 'name', 'name', 'varchar(64)', array('not null' => TRUE, 'default' => "''"));
break;
case 'mysql':
case 'mysqli':
$ret[] = update_sql("ALTER TABLE {role} CHANGE name name varchar(64) NOT NULL default ''");
break;
}
return $ret;
}
/**
* @} End of "defgroup updates-4.7-to-5.0"
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment