Adapts mentoring to the new sectors.
[platal.git] / upgrade / newdirectory-0.0.1 / 13_mentoring.sql
1 DROP TABLE IF EXISTS profile_mentor;
2 DROP TABLE IF EXISTS profile_mentor_country;
3 DROP TABLE IF EXISTS profile_mentor_sector;
4
5 CREATE TABLE IF NOT EXISTS profile_mentor (
6 uid INT(11) NOT NULL DEFAULT 0,
7 expertise TEXT NOT NULL,
8 PRIMARY KEY (uid),
9 FULLTEXT INDEX (expertise)
10 ) CHARSET=utf8;
11
12 INSERT INTO profile_mentor (uid, expertise)
13 SELECT uid, expertise
14 FROM mentor;
15
16 CREATE TABLE IF NOT EXISTS profile_mentor_country (
17 uid INT(11) NOT NULL DEFAULT 0,
18 country CHAR(2) NOT NULL DEFAULT "FR",
19 PRIMARY KEY (uid, country)
20 ) CHARSET=utf8;
21
22 INSERT INTO profile_mentor_country (uid, country)
23 SELECT uid, pid
24 FROM mentor_pays;
25
26 CREATE TABLE IF NOT EXISTS profile_mentor_sector (
27 uid INT(11) NOT NULL DEFAULT 0,
28 sectorid TINYINT(2) UNSIGNED NOT NULL,
29 subsectorid TINYINT(3) UNSIGNED NOT NULL,
30 PRIMARY KEY (uid, sectorid, subsectorid)
31 ) CHARSET=utf8;
32
33 -- vim:set syntax=mysql: