From 3141d02c2fbbfb1d7684b0de9c3e7adb7f338f3a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 14 Nov 2005 22:23:11 +0000 Subject: - Patch #28062 by Souvent22: make it possible to assign weights to contact form categories and fixed some small glitches. --- database/updates.inc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'database/updates.inc') 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; +} + /** -- cgit v1.2.3