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