ALTER TABLE `asc_precard` ADD `note` VARCHAR(100) NOT NULL COMMENT '備註' AFTER `status`;


INSERT INTO `asc_agent` (`id`, `name`, `appid`, `appkey`, `prefix`, `try_days`, `try_level`, `base_days`, `base_level`, `expire_action`, `ex_type`, `ex_func`, `create_time`, `update_time`, `delete_time`) VALUES ('2', '電商', 'ut00002', 'ilovetggo', 'ec', '7', '1', '0', '0', '0', '0', '', '2022-03-28 23:57:49', '2022-04-18 05:37:44', NULL);

CREATE TABLE `asc_user_nfc` (
  `id` int NOT NULL AUTO_INCREAMENT COMMENT '自增ID',
  `uid` varchar(10)  NOT NULL DEFAULT '0' COMMENT '卡號',
  `agent_id` int NOT NULL DEFAULT '0' COMMENT '代理ID',
  PRIMARY Key ('id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客戶卡片資料表';

ALTER TABLE `asc_user_nfc`
  ADD PRIMARY KEY (`id`);

CREATE TABLE `asc_user_auth` (
  `id` int NOT NULL AUTO_INCREAMENT COMMENT '自增ID',
  `user_id` varchar(255)  NOT NULL COMMENT '授權客戶編號',
  `auth_user_id` varchar(255)  NOT NULL COMMENT '被授權客戶編號',
  `auth_time` int NOT NULL COMMENT '授權結束時間',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
  `update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新時間',
  `delete_time` datetime DEFAULT NULL COMMENT '刪除時間',
  PRIMARY Key ('id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `asc_user` ADD `note` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '備註' AFTER `sales`;