ipld-eth-server/db/migrations/1516050071_add_log_fk_constraint.up.sql
2018-01-16 08:58:11 -06:00

12 lines
178 B
PL/PgSQL

BEGIN;
ALTER TABLE logs
ADD COLUMN receipt_id INT;
ALTER TABLE logs
ADD CONSTRAINT receipts_fk
FOREIGN KEY (receipt_id)
REFERENCES receipts (id)
ON DELETE CASCADE;
COMMIT;