ALTER IGNORE TABLE stock_item_month_rate ADD PRIMARY KEY (stock_item_month_rate_id)
ALTER IGNORE TABLE stock_item_month_rate MODIFY stock_item_month_rate_id INT NOT NULL
ALTER IGNORE TABLE stock_item_balance_history ADD PRIMARY KEY (stock_item_balance_history_id)
ALTER IGNORE TABLE stock_item_balance_history MODIFY stock_item_balance_history_id INT NOT NULL
ALTER TABLE stock_item_unit ADD `age_morethan_5_year` INT NULL
ALTER TABLE stock_item_unit ADD `age_5_year` INT NULL
ALTER TABLE stock_item_unit ADD `age_4_year` INT NULL
ALTER TABLE stock_item_unit ADD `age_3_year` INT NULL
ALTER TABLE stock_item_unit ADD `age_2_year` INT NULL
ALTER TABLE stock_item_unit ADD `age_1_year` INT NULL
ALTER TABLE stock_item_unit ADD `empty_in_day` INT NULL
ALTER TABLE stock_item_unit ADD `rate_1_month_lastyear` INT NULL
ALTER TABLE stock_item_unit ADD `rate_12_month` INT NULL
ALTER TABLE stock_item_unit ADD `rate_3_month` INT NULL
ALTER TABLE stock_item_unit ADD `rate_1_month` INT NULL
ALTER TABLE stock_item_unit ADD `last_active_date` DATE NULL
ALTER TABLE stock_item_month_rate ADD `balance_amount` DOUBLE(15,3) NULL
ALTER TABLE stock_item_month_rate ADD `pay_amount` DOUBLE(15,3) NULL
ALTER TABLE stock_item_month_rate ADD `receive_amount` DOUBLE(15,3) NULL
ALTER TABLE stock_item_month_rate ADD `stock_item_unit_id` INT NULL
ALTER TABLE stock_item_month_rate ADD `balance_qty` INT NULL
ALTER TABLE stock_item_month_rate ADD `pay_qty` INT NULL
ALTER TABLE stock_item_month_rate ADD `receive_qty` INT NULL
ALTER TABLE stock_item_month_rate ADD `item_date` DATE NULL
ALTER TABLE stock_item_month_rate ADD `item_month` INT NOT NULL
ALTER TABLE stock_item_month_rate ADD `item_year` INT NOT NULL
ALTER TABLE stock_item_month_rate ADD `item_id` INT NOT NULL
ALTER TABLE stock_item_balance_history ADD `adj_amount` INT NULL
ALTER TABLE stock_item_balance_history ADD `adj_qty` INT NULL
ALTER TABLE stock_item_balance_history ADD `warehouse_id` INT NULL
ALTER TABLE stock_item_balance_history ADD `pay_amount` DOUBLE(15,3) NULL
ALTER TABLE stock_item_balance_history ADD `pay_qty` INT NULL
ALTER TABLE stock_item_balance_history ADD `receive_amount` DOUBLE(15,3) NULL
ALTER TABLE stock_item_balance_history ADD `receive_qty` INT NULL
ALTER TABLE stock_item_balance_history ADD `stock_item_unit_id` INT NOT NULL
ALTER TABLE stock_item_balance_history ADD `amount` DOUBLE(15,3) NULL
ALTER TABLE stock_item_balance_history ADD `qty` INT NULL
ALTER TABLE stock_item_balance_history ADD `balance_date` DATE NOT NULL
ALTER TABLE stock_item_balance_history ADD `item_id` INT NOT NULL
CREATE TABLE stock_item_month_rate ( `stock_item_month_rate_id` INT NOT NULL )
CREATE TABLE stock_item_balance_history ( `stock_item_balance_history_id` INT NOT NULL )
DELETE FROM hosxp_ddl_index
DELETE FROM hosxp_ddl_field
CREATE TABLE IF NOT EXISTS `hosxp_ddl_index` ( `table_name` VARCHAR(150) NOT NULL DEFAULT "", `index_name` VARCHAR(150) NOT NULL DEFAULT "", `field_number` INT(11) DEFAULT NULL, `field_name` VARCHAR(150) NOT NULL DEFAULT "", `index_unique` CHAR(1) DEFAULT NULL, `index_seq` INT(11) DEFAULT NULL, PRIMARY KEY (`table_name`,`index_name`,`field_name`), KEY `index_name` (`index_name`), KEY `table_name` (`table_name`) )
DROP TABLE IF EXISTS hosxp_ddl_index
CREATE TABLE IF NOT EXISTS `hosxp_ddl_field` ( `table_name` VARCHAR(150) NOT NULL DEFAULT "", `field_name` VARCHAR(150) NOT NULL DEFAULT "", `field_type_mysql` VARCHAR(100) DEFAULT NULL, `field_type_postgresql` VARCHAR(100) DEFAULT NULL, `field_type_mssql` VARCHAR(100) DEFAULT NULL, `field_type_interbase` VARCHAR(100) DEFAULT NULL, `field_width` INT(11) DEFAULT NULL, `field_null` VARCHAR(10) DEFAULT NULL, `field_number` INT(11) DEFAULT NULL, `field_primary` CHAR(1) DEFAULT NULL, `field_type_oracle` VARCHAR(150) DEFAULT NULL, `field_type_native` VARCHAR(100) DEFAULT NULL, `field_precision` INT(11) DEFAULT NULL, `field_precision_text` VARCHAR(100) DEFAULT NULL, PRIMARY KEY (`table_name`,`field_name`), KEY `field_name` (`field_name`), KEY `table_name` (`table_name`) )
DROP TABLE IF EXISTS hosxp_ddl_field
UPDATE hosxp_dll_field DATA ...
CHANGE pk ON TABLE stock_item_balance_history --> stock_item_balance_history_id
CHANGE pk ON TABLE stock_item_month_rate --> stock_item_month_rate_id