From 9eb70cf81c097c324716df653558aef0f001fd46 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Thu, 13 Jun 2013 12:46:04 +0200 Subject: [PATCH] Add dummy contact to all contracts not having one. --- db_scripts/diff/13832.up | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 db_scripts/diff/13832.up diff --git a/db_scripts/diff/13832.up b/db_scripts/diff/13832.up new file mode 100644 index 00000000..44fdf2a8 --- /dev/null +++ b/db_scripts/diff/13832.up @@ -0,0 +1,10 @@ +USE billing; +SET AUTOCOMMIT=0; + +INSERT INTO contacts VALUES(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, now(), now(), NULL); + +SELECT LAST_INSERT_ID() INTO @contact_id; + +UPDATE contracts c, resellers r SET c.contact_id = @contact_id WHERE c.id = r.contract_id and c.contact_id IS NULL; + +COMMIT;