refactor customer and order ref

This commit is contained in:
Manuel Raynaud
2014-04-21 23:29:36 +02:00
parent 55a4edf906
commit 66c5a3729c
8 changed files with 83 additions and 80 deletions

View File

@@ -441,7 +441,7 @@ DROP TABLE IF EXISTS `customer`;
CREATE TABLE `customer`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`ref` VARCHAR(50) NOT NULL,
`ref` VARCHAR(50),
`title_id` INTEGER NOT NULL,
`firstname` VARCHAR(255) NOT NULL,
`lastname` VARCHAR(255) NOT NULL,
@@ -651,7 +651,7 @@ DROP TABLE IF EXISTS `order`;
CREATE TABLE `order`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`ref` VARCHAR(45) NOT NULL,
`ref` VARCHAR(45),
`customer_id` INTEGER NOT NULL,
`invoice_order_address_id` INTEGER NOT NULL,
`delivery_order_address_id` INTEGER NOT NULL,

View File

@@ -28,6 +28,10 @@ ALTER TABLE `feature_template` ADD INDEX `idx_feature_template_template_id_posit
ALTER TABLE `currency` ADD INDEX `idx_currency_code` (`code`);
ALTER TABLE `customer` CHANGE `ref` `ref` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ;
ALTER TABLE `order` CHANGE `ref` `ref` VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL ;
SELECT @max := MAX(`id`) FROM `resource`;
SET @max := @max+1;