-- Deploy gaia:api_2017_08_14_add_servicevideo to mysql

BEGIN;

CREATE TABLE `api_servicevideo` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `service_id` integer UNIQUE,
    `video_url` varchar(128) NOT NULL,
    `video_pic` varchar(128) NOT NULL,
    `persistentId` varchar(128) NOT NULL,
    `persistent_status` integer NOT NULL,
    `water_url` varchar(128) NOT NULL
);
ALTER TABLE `api_servicevideo` ADD CONSTRAINT `service_id_refs_id_224c0e82` FOREIGN KEY (`service_id`) REFERENCES `api_service` (`id`);

CREATE TABLE `api_serviceregistervideo` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `serviceregister_id` integer UNIQUE,
    `video_url` varchar(128) NOT NULL,
    `video_pic` varchar(128) NOT NULL,
    `persistentId` varchar(128) NOT NULL,
    `persistent_status` integer NOT NULL,
    `water_url` varchar(128) NOT NULL
);
ALTER TABLE `api_serviceregistervideo` ADD CONSTRAINT `serviceregister_id_refs_id_8010ea66` FOREIGN KEY (`serviceregister_id`) REFERENCES `api_serviceregister` (`id`);

COMMIT;
