1 CREATE TABLE IF NOT EXISTS profile_education_field_enum (
2 id INT(2) NOT NULL AUTO_INCREMENT
,
3 field
VARCHAR(255) DEFAULT NULL,
8 CREATE TABLE IF NOT EXISTS profile_education_degree_enum (
9 id INT(2) NOT NULL AUTO_INCREMENT
,
10 degree VARCHAR(255) DEFAULT NULL,
15 CREATE TABLE IF NOT EXISTS profile_education_degree (
16 eduid
INT(4) NOT NULL DEFAULT 0,
17 degreeid
INT(2) NOT NULL DEFAULT 0,
18 PRIMARY KEY(eduid
, degreeid
)
21 CREATE TABLE IF NOT EXISTS profile_education_enum (
22 id INT(4) NOT NULL AUTO_INCREMENT
,
23 name VARCHAR(255) DEFAULT NULL,
24 url
VARCHAR(255) DEFAULT NULL,
25 country
CHAR(2) NOT NULL DEFAULT 'FR',
30 CREATE TABLE IF NOT EXISTS profile_education (
31 id INT(2) NOT NULL DEFAULT 0,
32 uid
INT(11) NOT NULL DEFAULT 0,
33 eduid
INT(4) NOT NULL DEFAULT 0,
34 degreeid
INT(4) NOT NULL DEFAULT 0,
35 fieldid
INT(2) NOT NULL DEFAULT 0,
36 grad_year
INT(4) NOT NULL DEFAULT 0,
40 INSERT INTO profile_education_field_enum (field
)
41 VALUES ('Aéronautique'), ('Agronomie'), ('Assurance'), ('Biologie'),
42 ('Chimie'), ('Droit'), ('Économie'), ('Électronique/électricité'),
43 ('Environnement/développement durable'), ('Finance'), ('Géographie'),
44 ('Histoire'), ('Informatique'), ('Langues'), ('Mathématiques'),
45 ('Mathématiques appliquées'), ('Mécanique'), ('Médecine'),
46 ('Philosophie'), ('Physique'), ('Sciences politiques');
48 INSERT INTO profile_education_degree_enum (degree)
49 VALUES ('Diplôme'), ('Ingénieur'), ('Corps'), ('MS'), ('PhD'),
50 ('DEA'), ('ME'), ('MBA'), ('MiF'), ('MPA'), ('Licence');
52 INSERT INTO profile_education_degree (eduid
, degreeid
)
55 INNER JOIN profile_education_degree_enum
AS d
ON (FIND_IN_SET(d.
degree, a.
type));
57 INSERT INTO profile_education_enum (id, name, url
)
61 INSERT INTO profile_education (id, uid
, eduid
, degreeid
)
62 SELECT a.ordre
, a.uid
, a.aid
, d.
id
64 INNER JOIN profile_education_degree_enum
AS d
ON (a.
type = d.
degree);
67 # vim
:set syntax
=mysql
: