-- Deploy gaia:channel_2016_02_08_create_table_channel_verdor to mysql

BEGIN;

CREATE TABLE `channel_channelvendor` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(100) NOT NULL UNIQUE,
    `is_online` bool NOT NULL DEFAULT 1
)
;

ALTER TABLE `channel_channel`
    ADD COLUMN `vendor_id` integer,
    ADD COLUMN `type` integer NOT NULL DEFAULT 2
;

ALTER TABLE `channel_channel` ADD CONSTRAINT `vendor_id_refs_id_1a7a2baf` FOREIGN KEY (`vendor_id`) REFERENCES `channel_channelvendor` (`id`);

COMMIT;
