projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prepare db migration.
[platal.git]
/
upgrade
/
newdirectory-0.0.1
/
06_education.sql
diff --git
a/upgrade/newdirectory-0.0.1/06_education.sql
b/upgrade/newdirectory-0.0.1/06_education.sql
index
865d888
..
60d75e5
100644
(file)
--- a/
upgrade/newdirectory-0.0.1/06_education.sql
+++ b/
upgrade/newdirectory-0.0.1/06_education.sql
@@
-40,7
+40,8
@@
CREATE TABLE IF NOT EXISTS profile_education (
grad_year INT(4) DEFAULT NULL,
program VARCHAR(255) DEFAULT NULL,
flags SET('primary') DEFAULT '' NOT NULL,
grad_year INT(4) DEFAULT NULL,
program VARCHAR(255) DEFAULT NULL,
flags SET('primary') DEFAULT '' NOT NULL,
- PRIMARY KEY(id, uid)
+ PRIMARY KEY(id, uid),
+ INDEX uid (uid)
) CHARSET=utf8;
INSERT INTO profile_education_field_enum (field)
) CHARSET=utf8;
INSERT INTO profile_education_field_enum (field)
@@
-57,16
+58,16
@@
INSERT INTO profile_education_degree_enum (degree)
INSERT INTO profile_education_degree (eduid, degreeid)
SELECT a.id, d.id
INSERT INTO profile_education_degree (eduid, degreeid)
SELECT a.id, d.id
- FROM applis_def AS a
+ FROM
#x4dat#.
applis_def AS a
INNER JOIN profile_education_degree_enum AS d ON (FIND_IN_SET(d.degree, a.type));
INSERT INTO profile_education_enum (id, name, url)
SELECT id, text, url
INNER JOIN profile_education_degree_enum AS d ON (FIND_IN_SET(d.degree, a.type));
INSERT INTO profile_education_enum (id, name, url)
SELECT id, text, url
- FROM applis_def;
+ FROM
#x4dat#.
applis_def;
INSERT INTO profile_education (id, uid, eduid, degreeid)
SELECT a.ordre, a.uid, a.aid, d.id
INSERT INTO profile_education (id, uid, eduid, degreeid)
SELECT a.ordre, a.uid, a.aid, d.id
- FROM applis_ins AS a
+ FROM
#x4dat#.
applis_ins AS a
INNER JOIN profile_education_degree_enum AS d ON (a.type = d.degree);
UPDATE watch_profile AS w1
INNER JOIN profile_education_degree_enum AS d ON (a.type = d.degree);
UPDATE watch_profile AS w1
@@
-85,6
+86,7
@@
ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nation
UPDATE watch_profile SET field = 'edus' WHERE field = 'appli1';
UPDATE watch_profile SET field = 'edus' WHERE field = 'appli1';
+
DELETE FROM watch_profile WHERE field = 'appli2';
ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2',
DELETE FROM watch_profile WHERE field = 'appli2';
ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2',