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