fix: refs #7756 Foreign keys invoiceOut #2799

Merged
guillermo merged 3 commits from 7756-fixRefFk into dev 2024-08-20 06:49:54 +00:00
16 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1 @@
ALTER TABLE vn.ticket DROP FOREIGN KEY ticket_FK;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceOut DROP KEY Id_Factura;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceOut MODIFY COLUMN id int(10) unsigned NOT NULL;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceCorrection DROP FOREIGN KEY corrected_fk;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceCorrection DROP FOREIGN KEY correcting_fk;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceOutExpense DROP FOREIGN KEY invoiceOutExpence_FK_1;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceOutTax DROP FOREIGN KEY invoiceOutFk;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceOut DROP PRIMARY KEY;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceOut ADD CONSTRAINT invoiceOut_pk PRIMARY KEY (id);

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceOut ADD CONSTRAINT invoiceOut_unique UNIQUE KEY (`ref`);

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.ticket ADD CONSTRAINT ticket_invoiceOut_FK
FOREIGN KEY (refFk) REFERENCES vn.invoiceOut(`ref`) ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.invoiceCorrection ADD CONSTRAINT invoiceCorrection_invoiceOut_FK
FOREIGN KEY (correctingFk) REFERENCES vn.invoiceOut(id) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.invoiceCorrection ADD CONSTRAINT invoiceCorrection_invoiceOut_FK_1
FOREIGN KEY (correctedFk) REFERENCES vn.invoiceOut(id) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.invoiceOutExpense ADD CONSTRAINT invoiceOutExpense_invoiceOut_FK
FOREIGN KEY (invoiceOutFk) REFERENCES vn.invoiceOut(id) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.invoiceOutTax ADD CONSTRAINT invoiceOutTax_invoiceOut_FK
FOREIGN KEY (invoiceOutFk) REFERENCES vn.invoiceOut(id) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1 @@
ALTER TABLE vn.invoiceOut MODIFY COLUMN id int(10) unsigned auto_increment NOT NULL;