-- Deploy mimas-qa:qa_2018_07_31_send_answer to mysql

BEGIN;

CREATE TABLE `api_send_answer` (
	`id` integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
	`user_id` varchar(32) NOT NULL,
	`content` longtext NOT NULL,
	`cover_url` varchar(300) NULL,
	`create_time` datetime(6) NOT NULL,
	`push_time` datetime(6) NOT NULL,
	`update_time` datetime(6) NOT NULL,
	`level` integer NOT NULL,
	`rank` integer NOT NULL,
	`status` smallint NOT NULL,
	`celery_task_id` varchar(64) NOT NULL,
	`question_id` integer NOT NULL
);

ALTER TABLE `api_send_answer`
	ADD CONSTRAINT `api_send_answer_question_id_1b4bf74d_fk_api_question_id` FOREIGN KEY (`question_id`) REFERENCES `api_question` (`id`);

COMMIT;
