-- Deploy gaia:20200428_add_promotion_coupon to mysql

BEGIN;

-- XXX Add DDLs here.

CREATE TABLE `promotion_coupon` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `promotion_id` int(11) NOT NULL COMMENT '促销活动id',
  `coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '美劵id',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_promotion_coupon_promotion_id_deleted` (`promotion_id`,`deleted`),
  KEY `idx_promotion_coupon_coupon_id_deleted` (`coupon_id`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8 COMMENT='活动美劵表';

COMMIT;
