-- Deploy gaia:2020-07-24_modify_service_name_change_log_drop_column to mysql

BEGIN;

ALTER TABLE `api_service_name_change_log` DROP COLUMN change_name;
ALTER TABLE `api_service_name_change_log` DROP COLUMN change_attr_name;
ALTER TABLE `api_service_name_change_log` DROP COLUMN attr_id;
ALTER TABLE `api_service_name_change_log` DROP COLUMN attr_name;

CREATE TABLE `api_service_name_change_attr_log` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `service_id` integer NOT NULL,
    `doctor_id` varchar(100) NOT NULL,
    `change_attr_name` varchar(100) DEFAULT NULL,
    `attr_name` varchar(100) DEFAULT NULL,
    `attr_id` integer NOT NULL,
    `created_time` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

COMMIT;
