-- Deploy gaia:api_2016_07_05_add_table_api_seckillnotify to mysql

BEGIN;

CREATE TABLE `api_seckillnotify` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `service_id` int(11) NOT NULL,
  `special_id` int(11) NOT NULL,
  `seckill_id` int(11) NOT NULL,
  `person_id` char(32) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `api_seckillnotify_ref_api_service` (`service_id`),
  KEY `api_seckillnotify_ref_api_special` (`special_id`),
  KEY `api_seckillnotify_ref_api_specialseckillservice` (`seckill_id`),
  KEY `api_seckillnotify_ref_api_person` (`person_id`),
  CONSTRAINT `api_seckillnotify_ref_api_service` FOREIGN KEY (`service_id`) REFERENCES `api_service` (`id`) ON DELETE CASCADE,
  CONSTRAINT `api_seckillnotify_ref_api_person` FOREIGN KEY (`person_id`) REFERENCES `api_person` (`id`) ON DELETE CASCADE,
  CONSTRAINT `api_seckillnotify_ref_api_special` FOREIGN KEY (`special_id`) REFERENCES `api_special` (`id`) ON DELETE CASCADE,
  CONSTRAINT `api_seckillnotify_ref_api_specialseckillservice` FOREIGN KEY (`seckill_id`) REFERENCES `api_specialseckillservice` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

COMMIT;
