Commit | Line | Data |
---|---|---|
d1a2252a GB |
1 | CREATE TABLE IF NOT EXISTS `profile_networking_enum` ( |
2 | `network_type` tinyint unsigned NOT NULL, | |
3 | `name` varchar(30) NOT NULL, | |
4 | `icon` varchar(50) NOT NULL COMMENT 'icon filename', | |
92446a53 | 5 | `filter` enum('email','web','number','none') NOT NULL DEFAULT 'none' COMMENT 'filter type for addresses', |
d1a2252a GB |
6 | PRIMARY KEY (`network_type`) |
7 | ) CHARSET=utf8 COMMENT='types of networking addresses'; | |
8 | ||
9 | CREATE TABLE IF NOT EXISTS `profile_networking` ( | |
6337709a | 10 | `uid` int NOT NULL COMMENT 'user id', |
d1a2252a GB |
11 | `nwid` tinyint unsigned NOT NULL COMMENT 'number of the address for the user', |
12 | `network_type` tinyint unsigned NOT NULL, | |
13 | `address` varchar(255) NOT NULL, | |
14 | `pub` enum('private','public') NOT NULL DEFAULT 'private', | |
15 | PRIMARY KEY (`uid`, `nwid`) | |
16 | ) CHARSET=utf8 COMMENT='networking addresses'; | |
17 | ||
1052148d | 18 | -- Insert a first address type for old URLs |
d1a2252a GB |
19 | INSERT INTO `profile_networking_enum` (`network_type`, `name`, `icon`, `filter`) |
20 | VALUES (0, 'Page web', 'web.gif', 'web'); | |
21 | ||
22 | INSERT INTO `profile_networking` (`uid`, `nwid`, `network_type`, `address`, `pub`) | |
23 | SELECT `user_id`, 0, 0, `profile_web`, `profile_web_pub` | |
24 | FROM `auth_user_quick` | |
25 | WHERE `profile_web` <> ""; | |
26 | ||
1052148d GB |
27 | -- Modify watch_profile to update 'field' from web to networking |
28 | ALTER TABLE `watch_profile` | |
29 | MODIFY `field` enum('nom', 'freetext', 'mobile', 'nationalite', 'nick', | |
30 | 'web', 'networking', 'appli1', 'appli2', 'addresses', | |
31 | 'section', 'binets', 'medals', 'cv', 'jobs', 'photo'); | |
32 | ||
33 | UPDATE `watch_profile` SET `field` = 'networking' WHERE `field` = 'web'; | |
34 | ||
35 | ALTER TABLE `watch_profile` | |
36 | MODIFY `field` enum('nom', 'freetext', 'mobile', 'nationalite', 'nick', | |
37 | 'networking', 'appli1', 'appli2', 'addresses', | |
38 | 'section', 'binets', 'medals', 'cv', 'jobs', 'photo'); | |
39 | ||
40 | -- Drop old web URL columns | |
41 | ALTER TABLE `auth_user_quick` DROP COLUMN `profile_web`; | |
42 | ALTER TABLE `auth_user_quick` DROP COLUMN `profile_web_pub`; | |
43 |