Add dummy contact to all contracts not having one.

vseva/pbx_groups
Andreas Granig 13 years ago
parent c628728977
commit 9eb70cf81c

@ -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;
Loading…
Cancel
Save