Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
-- wrap in transaction
BEGIN;
-- customers.customer
ALTER TABLE IF EXISTS customers.customer
DROP CONSTRAINT IF EXISTS customer_address_id_fkey;
ALTER TABLE IF EXISTS customers.customer
ADD CONSTRAINT customer_address_id_fkey FOREIGN KEY (address_id)
REFERENCES customers.address (address_id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE RESTRICT;
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment