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 | 21 |
3 files changed, 23 insertions, 2 deletions
diff --git a/database/database.mysql b/database/database.mysql index c70982086..5449d420a 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -208,6 +208,8 @@ CREATE TABLE contact ( category varchar(255) NOT NULL default '', recipients longtext NOT NULL default '', reply longtext NOT NULL default '', + weight tinyint(3) NOT NULL default '0', + selected tinyint(1) NOT NULL default '0', PRIMARY KEY (cid), UNIQUE KEY category (category) ) TYPE=MyISAM; diff --git a/database/database.pgsql b/database/database.pgsql index 2c7e45b9c..0b4139a73 100644 --- a/database/database.pgsql +++ b/database/database.pgsql @@ -203,6 +203,8 @@ CREATE TABLE contact ( category varchar(255) NOT NULL default '', recipients text NOT NULL default '', reply text NOT NULL default '', + weight smallint NOT NULL default '0', + selected smallint NOT NULL default '0', PRIMARY KEY (cid), UNIQUE (category) ); diff --git a/database/updates.inc b/database/updates.inc index 20e11e835..8463ddc3e 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -103,7 +103,8 @@ $sql_updates = array( "2005-10-15" => "update_150", "2005-10-23" => "update_151", "2005-10-28" => "update_152", - "2005-11-03" => "update_153" + "2005-11-03" => "update_153", + "2005-11-14" => "update_154" ); function update_110() { @@ -1128,7 +1129,7 @@ function update_153(){ case 'pgsql': $ret[] = update_sql("ALTER TABLE {contact} DROP CONSTRAINT {contact}_pkey"); $ret[] = update_sql("CREATE SEQUENCE {contact}_cid_seq"); - db_add_column($ret, 'contact', 'cid', 'integer', array('not null' => TRUE, 'default' => "nextval('{contact}_cid_seq')")); + db_add_column($ret, 'contact', 'cid', 'int', array('not null' => TRUE, 'default' => "nextval('{contact}_cid_seq')")); $ret[] = update_sql("ALTER TABLE {contact} ADD PRIMARY KEY (cid)"); $ret[] = update_sql("ALTER TABLE {contact} ADD CONSTRAINT {contact}_category_key UNIQUE (category)"); break; @@ -1142,6 +1143,22 @@ function update_153(){ return $ret; } +function update_154() { + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'pgsql': + db_add_column($ret, 'contact', 'weight', 'smallint', array('not null' => TRUE, 'default' => 0)); + db_add_column($ret, 'contact', 'selected', 'smallint', array('not null' => TRUE, 'default' => 0)); + break; + case 'mysql': + case 'mysqli': + $ret[] = update_sql("ALTER TABLE {contact} ADD COLUMN weight tinyint(3) NOT NULL DEFAULT 0"); + $ret[] = update_sql("ALTER TABLE {contact} ADD COLUMN selected tinyint(1) NOT NULL DEFAULT 0"); + break; + } + return $ret; +} + /** |