From 54e13b5fb421917ff4ebfeb65c85d61a8ae663b8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 5 Nov 2005 08:00:20 +0000 Subject: - Patch #27140 by m3averck/souvent22: can't delete contact module subjects with '&' in title. --- database/updates.inc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'database/updates.inc') 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. -- cgit v1.2.3