update core
[platal.git] / upgrade / newdirectory-0.0.1 / 02_networking.sql
index 57f636c..0e4667d 100644 (file)
@@ -2,30 +2,31 @@ DROP TABLE IF EXISTS profile_networking_enum;
 DROP TABLE IF EXISTS profile_networking;
 
 CREATE TABLE `profile_networking_enum` (
-    `network_type` tinyint unsigned NOT NULL,
+    `nwid` tinyint unsigned NOT NULL,
     `name` varchar(30) NOT NULL,
     `icon` varchar(50) NOT NULL COMMENT 'icon filename',
     `filter` enum('email','web','number','none') NOT NULL DEFAULT 'none' COMMENT 'filter type for addresses',
+    `network_type` enum('web','im','social','other') NOT NULL DEFAULT 'other',
     `link` varchar(255) NOT NULL COMMENT 'string used to forge an URL linking to the the profile page',
-    PRIMARY KEY (`network_type`)
+    PRIMARY KEY (`nwid`)
 ) ENGINE=InnoDB, CHARSET=utf8, COMMENT='types of networking addresses';
 
 
 CREATE TABLE `profile_networking` (
     `pid` int NOT NULL COMMENT 'profile id',
-    `nwid` tinyint unsigned NOT NULL COMMENT 'number of the address for the user',
-    `network_type` tinyint unsigned NOT NULL,
+    `id` tinyint unsigned NOT NULL COMMENT 'number of the address for the user',
+    `nwid` tinyint unsigned NOT NULL COMMENT 'id of network, see profile_networking_enum',
     `address` varchar(255) NOT NULL,
     `pub` enum('private','public') NOT NULL DEFAULT 'private',
-    PRIMARY KEY (`pid`, `nwid`),
+    PRIMARY KEY (`pid`, `id`),
     INDEX uid (pid)
 ) ENGINE=InnoDB, 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');
+INSERT INTO `profile_networking_enum` (`nwid`, `name`, `icon`, `filter`, `network_type`, `link`)
+     VALUES (0, 'Page web', 'web.gif', 'web', 'web', '%s');
 
-INSERT INTO `profile_networking` (`pid`, `nwid`, `network_type`, `address`, `pub`)
+INSERT INTO `profile_networking` (`pid`, `id`, `nwid`, `address`, `pub`)
      SELECT `user_id`, 0, 0, `profile_web`, `profile_web_pub`
        FROM #x4dat#.`auth_user_quick`
       WHERE `profile_web` <> "";