<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="cn.skcks.docking.gb28181.wvp.orm.mybatis.operation.WvpProxyOperateTableMapper">
    <update id="createDeviceTable">
        CREATE TABLE IF NOT EXISTS `wvp_proxy_device`
        (
            `id`                   bigint(20)                             NOT NULL AUTO_INCREMENT,
            `device_code`          varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
            `gb_device_id`         varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
            `gb_device_channel_id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
            `name`                 varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
            `address`              varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
            PRIMARY KEY (`id`),
            UNIQUE KEY `device_code_2` (`device_code`, `gb_device_id`,
                                        `gb_device_channel_id`),
            KEY `device_code` (`device_code`) USING BTREE
        ) ENGINE = InnoDB
          AUTO_INCREMENT = 6
          DEFAULT CHARSET = utf8mb4
          COLLATE = utf8mb4_unicode_ci;
    </update>
    <update id="createDockingTable">
        CREATE TABLE IF NOT EXISTS `wvp_proxy_docking` (
                                             `id` bigint NOT NULL AUTO_INCREMENT,
                                             `gb_device_id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
                                             `ip` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
                                             `port` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
                                             PRIMARY KEY (`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    </update>
</mapper>
