-- Deploy gaia:add_anonymous_jpush_binding to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `api_jpushanonymousbinduser` (
    `id` integer NOT NULL AUTO_INCREMENT,
    `registration_id` varchar(64) NOT NULL,
    `city_id` varchar(40) DEFAULT NULL,

    PRIMARY KEY(`id`),

    CONSTRAINT `uk_registration_id` UNIQUE (`registration_id`),

    KEY `idx_city_id` (`city_id`),
    CONSTRAINT `fk_city` FOREIGN KEY (`city_id`) REFERENCES `api_city` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

COMMIT;
