X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=upgrade%2Ffusionax-0.0.1%2F02_networking.sql;h=17172c93ecffb6547dd2a435b5e8952426dbc1e4;hb=dc6378df04a613f3a65ae5e501b65de64a672b9a;hp=cf368ff2f4d924e8383bead466fedd42542e777a;hpb=d1a2252ae9275f499f3a1d843f540ae5aeea63a9;p=platal.git diff --git a/upgrade/fusionax-0.0.1/02_networking.sql b/upgrade/fusionax-0.0.1/02_networking.sql index cf368ff..17172c9 100644 --- a/upgrade/fusionax-0.0.1/02_networking.sql +++ b/upgrade/fusionax-0.0.1/02_networking.sql @@ -2,12 +2,13 @@ CREATE TABLE IF NOT EXISTS `profile_networking_enum` ( `network_type` tinyint unsigned NOT NULL, `name` varchar(30) NOT NULL, `icon` varchar(50) NOT NULL COMMENT 'icon filename', - `filter` enum('email','web','none') NOT NULL DEFAULT 'none' COMMENT 'filter type for addresses', + `filter` enum('email','web','number','none') NOT NULL DEFAULT 'none' COMMENT 'filter type for addresses', + `link` varchar(255) NOT NULL COMMENT 'string used to forge an URL linking to the the profile page', PRIMARY KEY (`network_type`) ) CHARSET=utf8 COMMENT='types of networking addresses'; CREATE TABLE IF NOT EXISTS `profile_networking` ( - `uid` smallint unsigned NOT NULL COMMENT 'user id', + `uid` int NOT NULL COMMENT 'user id', `nwid` tinyint unsigned NOT NULL COMMENT 'number of the address for the user', `network_type` tinyint unsigned NOT NULL, `address` varchar(255) NOT NULL, @@ -15,7 +16,7 @@ CREATE TABLE IF NOT EXISTS `profile_networking` ( PRIMARY KEY (`uid`, `nwid`) ) CHARSET=utf8 COMMENT='networking addresses'; - +-- Insert a first address type for old URLs INSERT INTO `profile_networking_enum` (`network_type`, `name`, `icon`, `filter`) VALUES (0, 'Page web', 'web.gif', 'web'); @@ -24,3 +25,20 @@ INSERT INTO `profile_networking` (`uid`, `nwid`, `network_type`, `address`, `pub FROM `auth_user_quick` WHERE `profile_web` <> ""; +-- Modify watch_profile to update 'field' from web to networking +ALTER TABLE `watch_profile` + MODIFY `field` enum('nom', 'freetext', 'mobile', 'nationalite', 'nick', + 'web', 'networking', 'appli1', 'appli2', 'addresses', + 'section', 'binets', 'medals', 'cv', 'jobs', 'photo'); + +UPDATE `watch_profile` SET `field` = 'networking' WHERE `field` = 'web'; + +ALTER TABLE `watch_profile` + MODIFY `field` enum('nom', 'freetext', 'mobile', 'nationalite', 'nick', + 'networking', 'appli1', 'appli2', 'addresses', + 'section', 'binets', 'medals', 'cv', 'jobs', 'photo'); + +-- Drop old web URL columns +ALTER TABLE `auth_user_quick` DROP COLUMN `profile_web`; +ALTER TABLE `auth_user_quick` DROP COLUMN `profile_web_pub`; +