-- Deploy gaia:doctor_2018_09_18_message_mechanism_chain to mysql

BEGIN;

-- XXX Add DDLs here.

CREATE TABLE `hippo_chain_merchant_master` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `mastermerchant_id` bigint NOT NULL UNIQUE
)
;
ALTER TABLE `hippo_chain_merchant_master` ADD CONSTRAINT `mastermerchant_id_refs_id_48305e8e` FOREIGN KEY (`mastermerchant_id`) REFERENCES `hippo_merchant` (`id`);
CREATE TABLE `hippo_chain_merchant_slave` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `mastermerchant_id` integer NOT NULL,
    `slavemerchant_id` bigint NOT NULL,
    `created_time` datetime(6) NOT NULL
)
;
ALTER TABLE `hippo_chain_merchant_slave` ADD CONSTRAINT `mastermerchant_id_refs_id_2b2e2345` FOREIGN KEY (`mastermerchant_id`) REFERENCES `hippo_chain_merchant_master` (`id`);
ALTER TABLE `hippo_chain_merchant_slave` ADD CONSTRAINT `slavemerchant_id_refs_id_905571b4` FOREIGN KEY (`slavemerchant_id`) REFERENCES `hippo_merchant` (`id`);

COMMIT;
