X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=upgrade%2Fnewdirectory-0.0.1%2F04_telephone.sql;h=bc66f789f046427a420c2ee71807b1ec52901e3b;hb=843a2191e4c76f0beb00c754f06974de76791238;hp=bff48ee349f30b3668de12b9d76b00194405f5d6;hpb=4a55e7da9dd68b35034d207a25d8ffb292f30403;p=platal.git diff --git a/upgrade/newdirectory-0.0.1/04_telephone.sql b/upgrade/newdirectory-0.0.1/04_telephone.sql index bff48ee..bc66f78 100644 --- a/upgrade/newdirectory-0.0.1/04_telephone.sql +++ b/upgrade/newdirectory-0.0.1/04_telephone.sql @@ -1,5 +1,7 @@ -CREATE TABLE IF NOT EXISTS `profile_phones` ( - `uid` smallint unsigned NOT NULL, +DROP TABLE IF EXISTS profile_phones; + +CREATE TABLE `profile_phones` ( + `pid` smallint unsigned NOT NULL, `link_type` enum('address', 'pro', 'user') NOT NULL DEFAULT 'user' COMMENT 'type of parent element', `link_id` tinyint unsigned NOT NULL COMMENT 'id of his parent element', `tel_id` tinyint unsigned NOT NULL COMMENT 'index of this number for the couple (user, parent element)', @@ -8,16 +10,10 @@ CREATE TABLE IF NOT EXISTS `profile_phones` ( `display_tel` varchar(30) NOT NULL COMMENT 'display number', `pub` enum('private', 'ax', 'public') NOT NULL DEFAULT 'private', `comment` varchar(80) NOT NULL, - PRIMARY KEY(`uid`, `link_type`, `link_id`, `tel_id`), + PRIMARY KEY(`pid`, `link_type`, `link_id`, `tel_id`), INDEX (`search_tel`), - INDEX uid (uid) -); - - --- Adds a temporary column to convert phone prefixes from varchar to int -ALTER TABLE `geoloc_pays` ADD COLUMN `tmp_phoneprf` smallint unsigned NULL; + INDEX pid (pid) +) ENGINE=InnoDB, CHARSET=utf8; --- Adds phone format column -ALTER TABLE `geoloc_pays` ADD COLUMN `phoneformat` varchar(25) NOT NULL AFTER `nat`; # vim:set syntax=mysql: