7299_testToMaster #2411

Merged
alexm merged 342 commits from 7299_testToMaster into master 2024-05-07 05:30:42 +00:00
1 changed files with 16 additions and 0 deletions
Showing only changes of commit 326c5c97bd - Show all commits

View File

@ -0,0 +1,16 @@
CREATE OR REPLACE TABLE `vn`.`farmingDeliveryNote` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`farmingFk` int(10) unsigned NOT NULL,
`deliveryNoteFk` int(11) NOT NULL,
`amount` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `farmingDeliveryNoteFk_FK` (`deliveryNoteFk`),
KEY `farmingDeliveryNoteFk_FK_1` (`farmingFk`),
CONSTRAINT `farmingDeliveryNoteFk_FK` FOREIGN KEY (`deliveryNoteFk`) REFERENCES `deliveryNote` (`id`),
CONSTRAINT `farmingDeliveryNoteFk_FK_1` FOREIGN KEY (`farmingFk`) REFERENCES `farming` (`id`)
);
INSERT IGNORE INTO `vn`.`farmingDeliveryNote` (farmingFk, deliveryNoteFk, amount)
SELECT farmingFk, id, amount
FROM deliveryNote dn
WHERE farmingFk;