-- Revert back to NO ACTION (RESTRICT behavior) ALTER TABLE expense_nonstocks DROP CONSTRAINT IF EXISTS fk_expense_nonstocks_expense_id; ALTER TABLE expense_nonstocks ADD CONSTRAINT fk_expense_nonstocks_expense_id FOREIGN KEY (expense_id) REFERENCES expenses(id) ON DELETE NO ACTION; -- Revert expense_realizations FK ALTER TABLE expense_realizations DROP CONSTRAINT IF EXISTS fk_expense_realizations_nonstock_id; ALTER TABLE expense_realizations ADD CONSTRAINT fk_expense_realizations_nonstock_id FOREIGN KEY (expense_nonstock_id) REFERENCES expense_nonstocks(id) ON DELETE NO ACTION;