mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
feat(db): seed reserved guest principal idempotently
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c9a0719128
commit
271504eec1
4 files changed
+46
-2
No files matched your search
@@ -202,7 +202,7 @@ describe("guest row exclusion", () => {
|
||||
await users.createUser("alice", "password123", "member");
|
||||
// Insert the reserved guest row directly (mirrors the migration).
|
||||
botDb.db.prepare(
|
||||
"INSERT INTO users (id, username, passwordHash, createdAt, updatedAt, role) VALUES (?, ?, ?, ?, ?, 'guest')"
|
||||
"INSERT OR IGNORE INTO users (id, username, passwordHash, createdAt, updatedAt, role) VALUES (?, ?, ?, ?, ?, 'guest')"
|
||||
).run(GUEST_USER_ID, GUEST_USERNAME, "!", Date.now(), Date.now());
|
||||
|
||||
expect(users.countUsers()).toBe(1); // alice only
|
||||
|
||||
Reference in new issue
Block a user