-- Deploy gaia:api_2017_06_14_create_watermark to mysql

BEGIN;

CREATE TABLE `api_watermark` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(100) NOT NULL,
    `image_url` varchar(256) NOT NULL,
    `start_time` datetime(6) NOT NULL,
    `end_time` datetime(6) NOT NULL
)
;
CREATE TABLE `api_watermarkservice` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `watermark_id` integer NOT NULL,
    `service_id` integer NOT NULL
)
;
ALTER TABLE `api_watermarkservice` ADD CONSTRAINT `service_id_refs_id_ca0dceb8` FOREIGN KEY (`service_id`) REFERENCES `api_service` (`id`);
ALTER TABLE `api_watermarkservice` ADD CONSTRAINT `watermark_id_refs_id_8ec25f6a` FOREIGN KEY (`watermark_id`) REFERENCES `api_watermark` (`id`);

COMMIT;
