-- Deploy gaia:2019_06_03_add_servicerelatedoperation_table to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `api_servicerelatedoperation` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `image` varchar(128) NOT NULL,
    `jump_id` varchar(128) NOT NULL,
    `jump_type` varchar(3) NOT NULL,
    `servicehome_id` integer NOT NULL,
    `position` smallint NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    UNIQUE (`servicehome_id`, `position`)
)
;
ALTER TABLE `api_servicerelatedoperation` ADD CONSTRAINT `servicehome_id_refs_id_81d5b590` FOREIGN KEY (`servicehome_id`) REFERENCES `api_service_home_operation` (`id`);
CREATE INDEX `api_servicerelatedoperation_f39b2118` ON `api_servicerelatedoperation` (`servicehome_id`);

COMMIT;
