Files
le-matelot/local/modules/WithdrawalInStore/Config/thelia.sql
2020-01-27 08:56:08 +01:00

26 lines
839 B
SQL

# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
-- ---------------------------------------------------------------------
-- WITHDRAWAL_IN_STORE
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `withdrawal_in_store`;
CREATE TABLE `withdrawal_in_store`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`area_id` INTEGER NOT NULL,
`amount` INTEGER NOT NULL,
PRIMARY KEY (`id`),
INDEX `FI_area_associated_WithdrawalInStore_area_id` (`area_id`),
CONSTRAINT `fk_area_associated_WithdrawalInStore_area_id`
FOREIGN KEY (`area_id`)
REFERENCES `area` (`id`)
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;