-- Deploy gaia:api_2016_12_09_create_table_qqcouponrecord to mysql

BEGIN;

CREATE TABLE `api_qqcouponrecord` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`card_id` varchar(128) NOT NULL,
`card_code` varchar(128) NOT NULL,
`authorization_code` varchar(128) NOT NULL,
`openid` varchar(128) NOT NULL,
`access_token` varchar(128) NOT NULL,
`attach` varchar(128) NOT NULL,
`phone` varchar(12) NOT NULL,
`gift_channel` varchar(8) NOT NULL,
`gift` varchar(64) NOT NULL,
`gain_time` datetime(6) NOT NULL
);

CREATE INDEX card_code_index
ON `api_qqcouponrecord` (`card_code`)
;

COMMIT;
