diff options
Diffstat (limited to 'database/updates.inc')
-rw-r--r-- | database/updates.inc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/database/updates.inc b/database/updates.inc index eb622abd8..f7ea33041 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -103,6 +103,7 @@ $sql_updates = array( "2005-10-15" => "update_150", "2005-10-23" => "update_151", "2005-10-28" => "update_152", + "2005-11-03" => "update_153" ); function update_110() { @@ -1119,6 +1120,24 @@ function update_152() { return $ret; } +function update_153(){ + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'pgsql': + $ret[] = update_sql("ALTER TABLE {contact} DROP CONSTRAINT {contact}_pkey category"); + $ret[] = update_sql("ALTER TABLE {contact} ADD COLUMN cid int PRIMARY KEY"); + $ret[] = update_sql("ALTER TABLE {contact} ADD UNIQUE (category)"); + case 'mysql': + case 'mysqli': + $ret[] = update_sql("ALTER TABLE {contact} DROP PRIMARY KEY"); + $ret[] = update_sql("ALTER TABLE {contact} ADD COLUMN cid int(11) NOT NULL PRIMARY KEY auto_increment"); + $ret[] = update_sql("ALTER TABLE {contact} ADD UNIQUE KEY category (category)"); + } + $ret = array(); + +} + + /** * Adds a column to a database. Uses syntax appropriate for PostgreSQL. |