Merge branch 'fusionax' into account
[platal.git] / upgrade / newdirectory-0.0.1 / 04_telephone.sql
CommitLineData
b235d980 1CREATE TABLE IF NOT EXISTS `profile_phones` (
de15699b
GB
2 `uid` smallint unsigned NOT NULL,
3 `link_type` enum('address', 'pro', 'user') NOT NULL DEFAULT 'user' COMMENT 'type of parent element',
4 `link_id` tinyint unsigned NOT NULL COMMENT 'id of his parent element',
5 `tel_id` tinyint unsigned NOT NULL COMMENT 'index of this number for the couple (user, parent element)',
6 `tel_type` enum('fixed', 'mobile', 'fax') NOT NULL DEFAULT 'fixed',
7 `search_tel` varchar(25) NOT NULL COMMENT 'search number in an international format with only digits and the initial +',
8 `display_tel` varchar(30) NOT NULL COMMENT 'display number',
9 `pub` enum('private', 'ax', 'public') NOT NULL DEFAULT 'private',
bde2be3b 10 `comment` varchar(80) NOT NULL,
de15699b 11 PRIMARY KEY(`uid`, `link_type`, `link_id`, `tel_id`),
aaeb5ec6
FB
12 INDEX (`search_tel`),
13 INDEX uid (uid)
de15699b
GB
14);
15
de15699b 16
b235d980
GB
17-- Adds a temporary column to convert phone prefixes from varchar to int
18ALTER TABLE `geoloc_pays` ADD COLUMN `tmp_phoneprf` smallint unsigned NULL;
19
20-- Adds phone format column
21ALTER TABLE `geoloc_pays` ADD COLUMN `phoneformat` varchar(25) NOT NULL AFTER `nat`;
de15699b 22
aaeb5ec6 23# vim:set syntax=mysql: