| 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 | INDEX uid (uid) |
| 21 | ) CHARSET=utf8; |
| 22 | |
| 23 | INSERT INTO profile_mentor_country (uid, country) |
| 24 | SELECT uid, pid |
| 25 | FROM mentor_pays; |
| 26 | |
| 27 | CREATE TABLE IF NOT EXISTS profile_mentor_sector ( |
| 28 | uid INT(11) NOT NULL DEFAULT 0, |
| 29 | sectorid TINYINT(2) UNSIGNED NOT NULL, |
| 30 | subsectorid TINYINT(3) UNSIGNED NOT NULL, |
| 31 | PRIMARY KEY (uid, sectorid, subsectorid), |
| 32 | INDEX uid (uid) |
| 33 | ) CHARSET=utf8; |
| 34 | |
| 35 | -- vim:set syntax=mysql: |