From: Anne Limoges Date: Sat, 8 Mar 2014 17:38:18 +0000 (+0100) Subject: Corrects birthdate when birthdate is null and birthdate_ref is correct. X-Git-Tag: xorg/1.1.12~3 X-Git-Url: http://git.polytechnique.org/?p=platal.git;a=commitdiff_plain;h=f49bd104fbfee0c74b33d4a3d24c7265d3700bef Corrects birthdate when birthdate is null and birthdate_ref is correct. --- diff --git a/upgrade/1.1.12/08_correct_birthdate.sql b/upgrade/1.1.12/08_correct_birthdate.sql new file mode 100644 index 0000000..39d1362 --- /dev/null +++ b/upgrade/1.1.12/08_correct_birthdate.sql @@ -0,0 +1,5 @@ +UPDATE profiles as p +LEFT JOIN account_profiles AS ap ON p.pid = ap.pid +LEFT JOIN accounts AS a ON a.uid = ap.uid +SET p.birthdate = p.birthdate_ref +WHERE p.birthdate_ref AND NOT p.birthdate AND a.state = 'active';