This commit is contained in:
parent
0384f7d83d
commit
d48fd77f48
|
@ -14,5 +14,11 @@ ALTER TABLE IF EXISTS vn.expenseManual ADD CONSTRAINT expenseManual_expense_FK F
|
||||||
|
|
||||||
ALTER TABLE IF EXISTS vn.expenseManual MODIFY COLUMN IF EXISTS companyFk int(10) unsigned NOT NULL;
|
ALTER TABLE IF EXISTS vn.expenseManual MODIFY COLUMN IF EXISTS companyFk int(10) unsigned NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE vn.expenseManual MODIFY COLUMN companyFk int(10) unsigned NULL;
|
||||||
|
|
||||||
|
UPDATE vn.expenseManual
|
||||||
|
SET companyFK= NULL
|
||||||
|
WHERE companyFk= 0
|
||||||
|
|
||||||
ALTER TABLE IF EXISTS vn.expenseManual ADD CONSTRAINT expenseManual_company_FK FOREIGN KEY IF NOT EXISTS (companyFk) REFERENCES vn.company(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
ALTER TABLE IF EXISTS vn.expenseManual ADD CONSTRAINT expenseManual_company_FK FOREIGN KEY IF NOT EXISTS (companyFk) REFERENCES vn.company(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue