支持已绑定设备追加 NFC 卡
This commit is contained in:
@@ -341,6 +341,8 @@ CREATE TABLE IF NOT EXISTS `device_bind_sessions` (
|
||||
`max_attempt_count` TINYINT UNSIGNED NOT NULL DEFAULT 5,
|
||||
`attempt_count` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`status` TINYINT NOT NULL DEFAULT 1,
|
||||
`bind_mode` TINYINT NOT NULL DEFAULT 1 COMMENT '1=device bind, 2=additional card bind',
|
||||
`card_uuid` VARCHAR(64) NULL,
|
||||
`confirmed_at` DATETIME NULL,
|
||||
`consumed_at` DATETIME NULL,
|
||||
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
@@ -351,6 +353,7 @@ CREATE TABLE IF NOT EXISTS `device_bind_sessions` (
|
||||
KEY `idx_device_bind_sessions_initiator_user_id` (`initiator_user_id`),
|
||||
KEY `idx_device_bind_sessions_target_child_id` (`target_child_id`),
|
||||
KEY `idx_device_bind_sessions_expires_at` (`expires_at`),
|
||||
KEY `idx_device_bind_sessions_card_uuid` (`card_uuid`),
|
||||
CONSTRAINT `fk_device_bind_sessions_device`
|
||||
FOREIGN KEY (`device_id`)
|
||||
REFERENCES `device_auth` (`device_id`),
|
||||
@@ -407,7 +410,7 @@ CREATE TABLE IF NOT EXISTS `cards` (
|
||||
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`card_id`),
|
||||
UNIQUE KEY `uq_cards_card_uuid` (`card_uuid`),
|
||||
UNIQUE KEY `uq_cards_device_id` (`device_id`),
|
||||
KEY `idx_cards_device_id` (`device_id`),
|
||||
KEY `idx_cards_status` (`status`),
|
||||
CONSTRAINT `fk_cards_device`
|
||||
FOREIGN KEY (`device_id`)
|
||||
|
||||
Reference in New Issue
Block a user