-- Deploy gaia:api_2017_06_12_create_table_api_skulock to mysql

BEGIN;

CREATE TABLE `api_skulock` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `locklist_id` integer NOT NULL,
    `serviceitem_id` integer NOT NULL,
    `created_time` datetime(6) NOT NULL,
    UNIQUE (`locklist_id`, `serviceitem_id`)
);
ALTER TABLE `api_skulock` ADD CONSTRAINT `locklist_id_refs_id_1c1a90a4` FOREIGN KEY (`locklist_id`) REFERENCES `api_locklist` (`id`);
ALTER TABLE `api_skulock` ADD CONSTRAINT `serviceitem_id_refs_id_de5bb853` FOREIGN KEY (`serviceitem_id`) REFERENCES `api_serviceitem` (`id`);

COMMIT;
