-- 加解密
CREATE TABLE `dev_cipher` (
    `id` bigint(20) NOT NULL,
    `rsa_private_key` text,
    `rsa_public_key` text,
    `rsa_public_key_md5` varchar(32) DEFAULT NULL,
    `sm2_private_key` text,
    `sm2_public_key` text,
    `sm2_public_key_md5` varchar(32) DEFAULT NULL,
    `device_sm2_public_key` text,
    `create_time` datetime DEFAULT NULL,
    `update_time` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `dev_info`
    ADD COLUMN `big_dipper_num` varchar(255) NULL COMMENT '北斗卡' AFTER `dev_picture`;

CREATE TABLE `dev_beidou_queue` (
    `id` bigint(20) NOT NULL,
    `device_number` varchar(20) DEFAULT NULL,
    `payload` text,
    `protocol` varchar(30) DEFAULT NULL,
    `function_code` varchar(10) DEFAULT NULL,
    `bei_dou_id` varchar(6) DEFAULT NULL,
    `send_by_bei_dou` tinyint(1) unsigned zerofill DEFAULT NULL,
    `retry_times` tinyint(1) DEFAULT NULL,
    `send_status` tinyint(1) DEFAULT NULL,
    `batch_number` varchar(20) DEFAULT NULL,
    `serial_number` varchar(4) DEFAULT NULL,
    `response_status` tinyint(4) DEFAULT '0',
    `play_status` tinyint(4) DEFAULT '0',
    `create_time` datetime DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;