From 33f7c5d88a6f6bd50aa30742724dc624b0b2010d Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Thu, 7 May 2026 19:49:38 +0800 Subject: [PATCH] feat: update schema synchronization note and add device fields to refresh_tokens and devices tables --- migrations/0001_init.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/migrations/0001_init.sql b/migrations/0001_init.sql index d6bbcb4..0197694 100644 --- a/migrations/0001_init.sql +++ b/migrations/0001_init.sql @@ -1,7 +1,7 @@ PRAGMA foreign_keys = ON; -- IMPORTANT: --- Keep this file in sync with src/services/storage.ts (SCHEMA_STATEMENTS). +-- Keep this file in sync with src/services/storage-schema.ts (SCHEMA_STATEMENTS). -- Any new table/column/index must be added to both places together. CREATE TABLE IF NOT EXISTS config ( @@ -124,6 +124,8 @@ CREATE TABLE IF NOT EXISTS refresh_tokens ( token TEXT PRIMARY KEY, user_id TEXT NOT NULL, expires_at INTEGER NOT NULL, + device_identifier TEXT, + device_session_stamp TEXT, FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ); CREATE INDEX IF NOT EXISTS idx_refresh_tokens_user ON refresh_tokens(user_id); @@ -164,6 +166,8 @@ CREATE TABLE IF NOT EXISTS devices ( encrypted_user_key TEXT, encrypted_public_key TEXT, encrypted_private_key TEXT, + banned INTEGER NOT NULL DEFAULT 0, + banned_at TEXT, device_note TEXT, last_seen_at TEXT, created_at TEXT NOT NULL,