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',
5 `
filter`
enum('email','web','number','none') NOT NULL DEFAULT 'none' COMMENT 'filter type for addresses',
6 PRIMARY KEY (`network_type`
)
7 ) CHARSET
=utf8
COMMENT='types of networking addresses';
9 CREATE TABLE IF NOT EXISTS `profile_networking`
(
10 `uid`
smallint unsigned
NOT NULL COMMENT 'user id',
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';
18 -- Insert a first address type for old URLs
19 INSERT INTO `profile_networking_enum`
(`network_type`
, `
name`
, `icon`
, `
filter`
)
20 VALUES (0, 'Page web', 'web.gif', 'web');
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`
<> "";
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');
33 UPDATE `watch_profile`
SET `field`
= 'networking' WHERE `field`
= 'web';
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');
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`
;