WIP : coupon refactor + fix

This commit is contained in:
gmorel
2013-09-26 17:47:50 +02:00
parent 73fde64f5b
commit fbf7ee1625

View File

@@ -51,7 +51,7 @@ CREATE TABLE `product`
REFERENCES `tax_rule` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL,
CONSTRAINT `fk_product_template1`
CONSTRAINT `fk_product_template`
FOREIGN KEY (`template_id`)
REFERENCES `template` (`id`)
) ENGINE=InnoDB;
@@ -186,7 +186,7 @@ CREATE TABLE `feature`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`visible` INTEGER DEFAULT 0,
`position` INTEGER NOT NULL,
`position` INTEGER,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`)
@@ -226,7 +226,7 @@ CREATE TABLE `feature_product`
`product_id` INTEGER NOT NULL,
`feature_id` INTEGER NOT NULL,
`feature_av_id` INTEGER,
`by_default` VARCHAR(255),
`free_text_value` TEXT,
`position` INTEGER,
`created_at` DATETIME,
`updated_at` DATETIME,
@@ -262,6 +262,7 @@ CREATE TABLE `feature_template`
`id` INTEGER NOT NULL AUTO_INCREMENT,
`feature_id` INTEGER NOT NULL,
`template_id` INTEGER NOT NULL,
`position` INTEGER,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
@@ -358,11 +359,12 @@ CREATE TABLE `product_sale_elements`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`product_id` INTEGER NOT NULL,
`ref` VARCHAR(45) NOT NULL,
`ref` VARCHAR(255) NOT NULL,
`quantity` FLOAT NOT NULL,
`promo` TINYINT DEFAULT 0,
`newness` TINYINT DEFAULT 0,
`weight` FLOAT,
`weight` FLOAT DEFAULT 0,
`is_default` TINYINT(1) DEFAULT 0,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
@@ -386,6 +388,7 @@ CREATE TABLE `attribute_template`
`id` INTEGER NOT NULL AUTO_INCREMENT,
`attribute_id` INTEGER NOT NULL,
`template_id` INTEGER NOT NULL,
`position` INTEGER,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
@@ -815,7 +818,7 @@ CREATE TABLE `order_product_attribute_combination`
`attribute_title` VARCHAR(255) NOT NULL,
`attribute_chapo` TEXT,
`attribute_description` LONGTEXT,
`attribute_postscriptumn` TEXT,
`attribute_postscriptum` TEXT,
`attribute_av_title` VARCHAR(255) NOT NULL,
`attribute_av_chapo` TEXT,
`attribute_av_description` LONGTEXT,
@@ -1098,14 +1101,14 @@ CREATE TABLE `coupon`
`code` VARCHAR(45) NOT NULL,
`type` VARCHAR(255) NOT NULL,
`amount` FLOAT NOT NULL,
`is_used` TINYINT NOT NULL,
`is_enabled` TINYINT NOT NULL,
`is_enabled` TINYINT(1) NOT NULL,
`expiration_date` DATETIME NOT NULL,
`serialized_rules` TEXT NOT NULL,
`is_cumulative` TINYINT NOT NULL,
`is_removing_postage` TINYINT NOT NULL,
`max_usage` INTEGER NOT NULL,
`is_cumulative` TINYINT(1) NOT NULL,
`is_removing_postage` TINYINT(1) NOT NULL,
`is_available_on_special_offers` TINYINT(1) NOT NULL,
`is_used` TINYINT(1) NOT NULL,
`serialized_conditions` TEXT NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
`version` INTEGER DEFAULT 0,
@@ -1586,6 +1589,7 @@ CREATE TABLE `order_product_tax`
`title` VARCHAR(255) NOT NULL,
`description` LONGTEXT,
`amount` FLOAT NOT NULL,
`promo_amount` FLOAT,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
@@ -2346,14 +2350,14 @@ CREATE TABLE `coupon_version`
`code` VARCHAR(45) NOT NULL,
`type` VARCHAR(255) NOT NULL,
`amount` FLOAT NOT NULL,
`is_used` TINYINT NOT NULL,
`is_enabled` TINYINT NOT NULL,
`is_enabled` TINYINT(1) NOT NULL,
`expiration_date` DATETIME NOT NULL,
`serialized_rules` TEXT NOT NULL,
`is_cumulative` TINYINT NOT NULL,
`is_removing_postage` TINYINT NOT NULL,
`max_usage` INTEGER NOT NULL,
`is_cumulative` TINYINT(1) NOT NULL,
`is_removing_postage` TINYINT(1) NOT NULL,
`is_available_on_special_offers` TINYINT(1) NOT NULL,
`is_used` TINYINT(1) NOT NULL,
`serialized_conditions` TEXT NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
`version` INTEGER DEFAULT 0 NOT NULL,