-- Deploy gaia:api_2017_03_14_create_api_skupricelog to mysql

BEGIN;

CREATE TABLE `api_skupricelog` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `sku_id` integer NOT NULL,
    `sku_name` varchar(50) NOT NULL,
    `gengmei_price` integer NOT NULL,
    `pre_payment_price` integer NOT NULL,
    `cash_back_rate` integer NOT NULL,
    `cash_back_fee` integer NOT NULL,
    `discount` integer NOT NULL,
    `self_support_discount` integer NOT NULL,
    `start_time` datetime(6) NOT NULL,
    `end_time` datetime(6),
    `activity_id` varchar(50),
    `create_time` datetime(6) NOT NULL
)
;
ALTER TABLE `api_skupricelog` ADD CONSTRAINT `sku_id_refs_id_0f9fd508` FOREIGN KEY (`sku_id`) REFERENCES `api_serviceitem` (`id`);

COMMIT;
