-- Deploy gaia:api_2016_08_23_add_columns_for_serviceregister to mysql

BEGIN;

-- XXX Add DDLs here.


ALTER TABLE `api_serviceregister` ADD COLUMN `review_status` VARCHAR(8) DEFAULT NULL;
ALTER TABLE `api_serviceregister` ADD COLUMN `last_review_time` datetime(6);
ALTER TABLE `api_serviceregister` ADD COLUMN `last_submit_time` datetime(6);



ALTER TABLE `api_serviceregister` ADD COLUMN `photo_details` text;

ALTER TABLE `api_serviceregister` ADD COLUMN `is_register` bool  DEFAULT FALSE;

ALTER TABLE `api_service` ADD COLUMN `photo_details_doctor` text;
ALTER TABLE `api_service` ADD COLUMN `photo_details_operate` text;


ALTER TABLE `api_serviceregister` ADD COLUMN `project_type_id` INT NULL DEFAULT NULL;

ALTER TABLE `api_serviceregister` ADD CONSTRAINT `tag_id_refs_id_137a11ef` FOREIGN KEY (`project_type_id`) REFERENCES `api_tag` (`id`);


ALTER TABLE `api_service` ADD COLUMN `project_type_id` INT NULL DEFAULT NULL;

ALTER TABLE `api_service` ADD CONSTRAINT `tag_id_refs_id_137a11ee` FOREIGN KEY (`project_type_id`) REFERENCES `api_tag` (`id`);


ALTER TABLE `api_serviceitem` ADD COLUMN `sort` INT NOT NULL DEFAULT 99999;

ALTER TABLE `api_serviceregisteritem` ADD COLUMN `sort` INT NOT NULL DEFAULT 99999;

ALTER TABLE `api_serviceregister` ADD COLUMN `short_description` VARCHAR(100) DEFAULT NULL;

ALTER TABLE `api_serviceregister` ADD COLUMN `image_header` VARCHAR(100) DEFAULT NULL;

ALTER TABLE `api_serviceregister` ADD COLUMN `is_specialreview` bool  DEFAULT FALSE;

COMMIT;
