Merge branch 'xorg/master' into xorg/f/geocoding
[platal.git] / upgrade / 1.1.1 / 14_contacts.sql
1 ALTER TABLE contacts DROP FOREIGN KEY contacts_ibfk_2;
2 DELETE FROM contacts
3 WHERE NOT EXISTS (SELECT profiles.*
4 FROM profiles
5 WHERE profiles.pid = contacts.contact);
6 ALTER TABLE contacts ADD FOREIGN KEY (contact) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE;
7
8 -- vim:set syntax=mysql: