-- dependson: api_0001_add_table_campaign.sql
-- model: api.models.Service, api.models.Special, api.models.SpecialItem
-- description:
--  alter table api_service, add column seckill_sell_num_limit
--  alter table api_couponinfo, add column channel
--  alter table api_specialitem, add column is_recommend

-- author: Pengfei.X
-- date: 2015.08.31 14:46:00

BEGIN;

ALTER TABLE api_service ADD COLUMN `seckill_sell_num_limit` int(11) DEFAULT NULL;

ALTER TABLE api_special ADD COLUMN `is_overflow` tinyint(1) NOT NULL;
ALTER TABLE api_special ADD COLUMN `campaign_id` int(11) DEFAULT NULL;
ALTER TABLE api_special ADD COLUMN `purchase_limit` tinyint(1) NOT NULL;
ALTER TABLE api_special ADD CONSTRAINT `fk_special_campaign_id` FOREIGN KEY (`campaign_id`) REFERENCES `api_campaign` (`id`);

ALTER TABLE api_specialitem ADD COLUMN `is_recommend` tinyint(1) NOT NULL;

COMMIT;
