mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
FIX(BE): update foreign key constraints to use ON DELETE NO ACTION for expense and marketing tables
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- 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;
|
||||
Reference in New Issue
Block a user