ALTER TABLE `user` ADD COLUMN `permission` int NULL DEFAULT NULL;
ALTER TABLE `user` ADD COLUMN `licensekey` varchar(255) NULL DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `faq` (
	`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
	`title` VARCHAR(200) NOT NULL,
	`description` MEDIUMTEXT NOT NULL,
	`register_id` BIGINT(20) NOT NULL,
	`modify_id` BIGINT(20) NOT NULL,
	`register_date` TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
	`modify_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
    `status` INT(11) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `qna` (
	`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
	`title` VARCHAR(200) NOT NULL,
	`description` MEDIUMTEXT NOT NULL,
	`register_id` BIGINT(20) NOT NULL,
	`modify_id` BIGINT(20) NOT NULL,
	`register_date` TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
	`modify_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `qna_answer` (
	`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
	`ask_id` BIGINT(20) NOT NULL,
	`title` VARCHAR(200) NOT NULL,
	`description` MEDIUMTEXT NOT NULL,
	`register_id` BIGINT(20) NOT NULL,
	`modify_id` BIGINT(20) NOT NULL,
	`register_date` TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
	`modify_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `event` (
	`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
	`title` VARCHAR(200) NOT NULL,
	`description` MEDIUMTEXT NOT NULL,
	`register_id` BIGINT(20) NOT NULL,
	`modify_id` BIGINT(20) NOT NULL,
	`register_date` TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
	`modify_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
    `start_date` varchar(10) DEFAULT NULL COMMENT 'start_date',
    `end_date` varchar(10) DEFAULT NULL COMMENT 'end_date',
	`status` INT(11) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `guide` (
	`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
	`title` VARCHAR(200) NOT NULL,
	`description` MEDIUMTEXT NOT NULL,
	`register_id` BIGINT(20) NOT NULL,
	`modify_id` BIGINT(20) NOT NULL,
	`register_date` TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
	`modify_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
	`status` INT(11) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;