-- Deploy mimas-qa:qa_2017_10_17_spam_label to mysql

BEGIN;

-- XXX Add DDLs here.
ALTER TABLE `api_question` ADD COLUMN `spam_label` SMALLINT NOT NULL DEFAULT '0';
UPDATE `api_question` SET spam_label = is_spam;
ALTER TABLE `api_answer` ADD COLUMN `spam_label` SMALLINT NOT NULL DEFAULT '0';
UPDATE `api_answer` SET spam_label = is_spam;
ALTER TABLE `api_answer_reply` ADD COLUMN  `spam_label` SMALLINT NOT NULL DEFAULT '0';
UPDATE `api_answer_reply` SET spam_label = is_spam;

COMMIT;
