Add foreign key constraints for order_address
modifié: core/lib/Thelia/Model/Base/Country.php modifié: core/lib/Thelia/Model/Base/CountryQuery.php modifié: core/lib/Thelia/Model/Base/CustomerTitle.php modifié: core/lib/Thelia/Model/Base/CustomerTitleQuery.php modifié: core/lib/Thelia/Model/Base/OrderAddress.php modifié: core/lib/Thelia/Model/Base/OrderAddressQuery.php modifié: core/lib/Thelia/Model/Map/CountryTableMap.php modifié: core/lib/Thelia/Model/Map/CustomerTitleTableMap.php modifié: core/lib/Thelia/Model/Map/OrderAddressTableMap.php modifié: local/config/schema.xml modifié: setup/thelia.sql modifié: setup/update/2.0.3.sql
This commit is contained in:
@@ -775,7 +775,19 @@ CREATE TABLE `order_address`
|
||||
`country_id` INTEGER NOT NULL,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FI_order_address_customer_title_id` (`customer_title_id`),
|
||||
INDEX `FI_order_address_country_id` (`country_id`),
|
||||
CONSTRAINT `fk_order_address_customer_title_id`
|
||||
FOREIGN KEY (`customer_title_id`)
|
||||
REFERENCES `customer_title` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE RESTRICT,
|
||||
CONSTRAINT `fk_order_address_country_id`
|
||||
FOREIGN KEY (`country_id`)
|
||||
REFERENCES `country` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE RESTRICT
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
@@ -15,6 +15,21 @@ ALTER TABLE `order` ADD `version` INT DEFAULT 0 AFTER `updated_at`;
|
||||
ALTER TABLE `order` ADD `version_created_at` DATE AFTER `version`;
|
||||
ALTER TABLE `order` ADD `version_created_by` VARCHAR(100) AFTER `version_created_at`;
|
||||
|
||||
ALTER TABLE `order_address`
|
||||
ADD CONSTRAINT `fk_order_address_customer_title_id`
|
||||
FOREIGN KEY (`customer_title_id`)
|
||||
REFERENCES `customer_title` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE RESTRICT
|
||||
;
|
||||
ALTER TABLE `order_address`
|
||||
ADD CONSTRAINT `fk_order_address_country_id`
|
||||
FOREIGN KEY (`country_id`)
|
||||
REFERENCES `country` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE RESTRICT
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS `order_version`;
|
||||
|
||||
CREATE TABLE `order_version`
|
||||
|
||||
Reference in New Issue
Block a user