From f49bd104fbfee0c74b33d4a3d24c7265d3700bef Mon Sep 17 00:00:00 2001 From: Anne Limoges Date: Sat, 8 Mar 2014 18:38:18 +0100 Subject: [PATCH] Corrects birthdate when birthdate is null and birthdate_ref is correct. --- upgrade/1.1.12/08_correct_birthdate.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 upgrade/1.1.12/08_correct_birthdate.sql 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'; -- 2.1.4