summaryrefslogtreecommitdiff
path: root/database/updates.inc
diff options
context:
space:
mode:
Diffstat (limited to 'database/updates.inc')
-rw-r--r--database/updates.inc21
1 files changed, 19 insertions, 2 deletions
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;
+}
+
/**