Commit c38da788 authored by Steven Wittens's avatar Steven Wittens

- #27985: make node type column bigger

parent 0c8d7422
......@@ -402,7 +402,7 @@ CREATE TABLE moderation_votes (
CREATE TABLE node (
nid int(10) unsigned NOT NULL auto_increment,
type varchar(16) NOT NULL default '',
type varchar(32) NOT NULL default '',
title varchar(128) NOT NULL default '',
uid int(10) NOT NULL default '0',
status int(4) NOT NULL default '1',
......
......@@ -402,7 +402,7 @@ CREATE TABLE moderation_votes (
CREATE TABLE node (
nid SERIAL,
type varchar(16) NOT NULL default '',
type varchar(32) NOT NULL default '',
title varchar(128) NOT NULL default '',
uid integer NOT NULL default '0',
status integer NOT NULL default '1',
......
......@@ -119,7 +119,8 @@
"2005-05-12" => "update_140",
"2005-05-22" => "update_141",
"2005-07-29" => "update_142",
"2005-07-30" => "update_143"
"2005-07-30" => "update_143",
"2005-08-08" => "update_144"
);
function update_32() {
......@@ -2533,6 +2534,22 @@ function update_143() {
return $ret;
}
function update_144() {
$ret = array();
if ($GLOBALS['db_type'] == 'mysql') {
$ret[] = update_sql("ALTER TABLE {node} CHANGE type type VARCHAR(32) NOT NULL");
}
elseif ($GLOBALS['db_type'] == 'pgsql') {
$ret[] = update_sql("ALTER TABLE {node} RENAME type TO type_old");
$ret[] = update_sql("ALTER TABLE {node} ADD type varchar(32)");
$ret[] = update_sql("ALTER TABLE {node} ALTER type SET NOT NULL");
$ret[] = update_sql("ALTER TABLE {node} ALTER type SET DEFAULT ''");
$ret[] = update_sql("UPDATE {node} SET type = type_old");
$ret[] = update_sql("ALTER TABLE {node} DROP type_old");
}
return $ret;
}
function update_sql($sql) {
$edit = $_POST["edit"];
$result = db_query($sql);
......
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