MEK 관련 DB 스키마 생성

This commit is contained in:
static
2024-12-29 18:01:02 +09:00
parent 46938ef700
commit bbba449819
5 changed files with 76 additions and 11 deletions

View File

@@ -18,7 +18,6 @@ export const userClient = sqliteTable(
state: text("state", { enum: ["challenging", "pending", "active"] })
.notNull()
.default("challenging"),
encKey: text("encrypted_key"),
},
(t) => ({
pk: primaryKey({ columns: [t.userId, t.clientId] }),
@@ -33,7 +32,7 @@ export const userClientChallenge = sqliteTable("user_client_challenge", {
clientId: integer("client_id")
.notNull()
.references(() => client.id),
challenge: text("challenge").notNull().unique(), // Base64
answer: text("challenge").notNull().unique(), // Base64
allowedIp: text("allowed_ip").notNull(),
expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),
});