-- Deploy gaia:campaigngift_2016_06_27_add_campaigngift_table to mysql

BEGIN;

CREATE TABLE `api_campaigngift` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `campaigncouponpage_id` integer NOT NULL,
    `gift_id` integer NOT NULL,
    `ordering` integer NOT NULL
)
;
ALTER TABLE `api_campaigngift` ADD CONSTRAINT `gift_id_refs_id_afa581db` FOREIGN KEY (`gift_id`) REFERENCES `api_coupongift` (`id`);
ALTER TABLE `api_campaigngift` ADD CONSTRAINT `campaigncouponpage_id_refs_id_a79737a5` FOREIGN KEY (`campaigncouponpage_id`) REFERENCES `api_campaigncouponpage` (`id`);

COMMIT;
