-- Deploy mimas-talos:20200508-fake-reply-pool to mysql

BEGIN;

CREATE TABLE `api_fake_replies` (
	`id` integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
	`content` varchar(200) NOT NULL,
	`is_online` tinyint(1) NOT NULL DEFAULT 1
);

CREATE TABLE `api_fake_reply_tag` (
	`id` integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
	`band_type` smallint NOT NULL,
	`is_online` tinyint(1) NOT NULL DEFAULT 1,
	`tag_id` integer NOT NULL DEFAULT 0,
	`tag_group_id` integer NOT NULL DEFAULT 0,
	`tag_attr_id` integer NOT NULL DEFAULT 0
);

CREATE TABLE `api_fake_config_map_reply` (
	`id` integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
	`is_online` tinyint(1) NOT NULL DEFAULT 1,
	`reply_id` integer NOT NULL,
	`config_id` integer NOT NULL
);

CREATE INDEX `reply_id` ON `api_fake_config_map_reply` (`reply_id`);
CREATE INDEX `config_id` ON `api_fake_config_map_reply` (`config_id`);

COMMIT;
