diff options
Diffstat (limited to 'database')
-rw-r--r-- | database/database.mysql | 2 | ||||
-rw-r--r-- | database/database.pgsql | 2 | ||||
-rw-r--r-- | database/updates.inc | 19 |
3 files changed, 20 insertions, 3 deletions
diff --git a/database/database.mysql b/database/database.mysql index ea8d8b454..7496db8f2 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -327,7 +327,7 @@ CREATE TABLE node ( teaser longtext NOT NULL, body longtext NOT NULL, revisions longtext NOT NULL, - static int(2) NOT NULL default '0', + sticky int(2) NOT NULL default '0', PRIMARY KEY (nid), KEY node_type (type(4)), KEY node_title_type (title,type(4)), diff --git a/database/database.pgsql b/database/database.pgsql index b91616ea6..bb4ae1e3d 100644 --- a/database/database.pgsql +++ b/database/database.pgsql @@ -327,7 +327,7 @@ CREATE TABLE node ( body text NOT NULL default '', changed integer NOT NULL default '0', revisions text NOT NULL default '', - static integer NOT NULL default '0', + sticky integer NOT NULL default '0', PRIMARY KEY (nid) ); CREATE INDEX node_type_idx ON node(type); diff --git a/database/updates.inc b/database/updates.inc index c6c7f00e0..ba66ff511 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -59,7 +59,8 @@ $sql_updates = array( "2004-04-27" => "update_85", "2004-05-10" => "update_86", "2004-05-18" => "update_87", - "2004-06-11" => "update_88" + "2004-06-11" => "update_88", + "2004-06-18" => "update_89" ); function update_32() { @@ -1103,6 +1104,22 @@ function update_88() { return $ret; } +function update_89() { + $ret = array(); + $ret[] = update_sql("ALTER TABLE {node} CHANGE static sticky INT(2) DEFAULT '0' NOT NULL"); + + // Change the node settings, so that it uses node_sticky_$type instead of node_static_$type + $result = db_query("SELECT * FROM {variable} WHERE name LIKE 'node_static_%'"); + while ($variable = db_fetch_object($result)) { + //get the node type name, place it into $name_arr. The name can be found with $name_arr[2] + $name_arr = explode("_",$variable->name); + $ret[] = update_sql("INSERT INTO {variable} (name,value) VALUES ('node_sticky_".$name_arr[2]."','".$variable->value."')"); + } + $ret[] = db_query("DELETE FROM {variable} WHERE name LIKE 'node_static_%'"); + + return $ret; +} + function update_sql($sql) { $edit = $_POST["edit"]; $result = db_query($sql); |