X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=upgrade%2Fnewdirectory-0.0.1%2F06_education.sql;h=708e8eff884c42dfe90f0a3ac15e0819df972711;hb=97a986879bcebfe8de032a927470c4b22597c80d;hp=16982fa4e9ad74eca85706b19467116166970f51;hpb=acc9be56f2cc773f7e684f9cd3201141bc126ee2;p=platal.git diff --git a/upgrade/newdirectory-0.0.1/06_education.sql b/upgrade/newdirectory-0.0.1/06_education.sql index 16982fa..708e8ef 100644 --- a/upgrade/newdirectory-0.0.1/06_education.sql +++ b/upgrade/newdirectory-0.0.1/06_education.sql @@ -8,6 +8,8 @@ CREATE TABLE IF NOT EXISTS profile_education_field_enum ( CREATE TABLE IF NOT EXISTS profile_education_degree_enum ( id INT(2) NOT NULL AUTO_INCREMENT, degree VARCHAR(255) DEFAULT NULL, + abbreviation VARCHAR(255) DEFAULT '' NOT NULL, + level TINYINT (1) UNSIGNED DEFAULT 0 NOT NULL, PRIMARY KEY(id), UNIQUE KEY(degree) ) CHARSET=utf8; @@ -21,6 +23,7 @@ CREATE TABLE IF NOT EXISTS profile_education_degree ( CREATE TABLE IF NOT EXISTS profile_education_enum ( id INT(4) NOT NULL AUTO_INCREMENT, name VARCHAR(255) DEFAULT NULL, + abbreviation VARCHAR(255) DEFAULT '' NOT NULL, url VARCHAR(255) DEFAULT NULL, country CHAR(2) NOT NULL DEFAULT 'FR', PRIMARY KEY(id), @@ -28,14 +31,17 @@ CREATE TABLE IF NOT EXISTS profile_education_enum ( ) CHARSET=utf8; CREATE TABLE IF NOT EXISTS profile_education ( - id INT(2) NOT NULL DEFAULT 0, + id TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, uid INT(11) NOT NULL DEFAULT 0, eduid INT(4) NOT NULL DEFAULT 0, degreeid INT(4) NOT NULL DEFAULT 0, fieldid INT(2) NOT NULL DEFAULT 0, + entry_year INT(4) DEFAULT NULL, grad_year INT(4) DEFAULT NULL, program VARCHAR(255) DEFAULT NULL, - PRIMARY KEY(id, uid) + flags SET('primary') DEFAULT '' NOT NULL, + PRIMARY KEY(id, uid), + INDEX uid (uid) ) CHARSET=utf8; INSERT INTO profile_education_field_enum (field)