클라이언트 등록시 검증키도 등록하도록 변경 (WiP)

This commit is contained in:
static
2024-12-31 01:56:12 +09:00
parent 679b223346
commit 4f20d2edbf
6 changed files with 140 additions and 35 deletions

View File

@@ -1,10 +1,17 @@
import { sqliteTable, text, integer, primaryKey } from "drizzle-orm/sqlite-core";
import { sqliteTable, text, integer, primaryKey, unique } from "drizzle-orm/sqlite-core";
import { user } from "./user";
export const client = sqliteTable("client", {
id: integer("id").primaryKey(),
pubKey: text("public_key").notNull().unique(), // Base64
});
export const client = sqliteTable(
"client",
{
id: integer("id").primaryKey(),
encPubKey: text("encryption_public_key").notNull().unique(), // Base64
sigPubKey: text("signature_public_key").notNull().unique(), // Base64
},
(t) => ({
unq: unique().on(t.encPubKey, t.sigPubKey),
}),
);
export const userClient = sqliteTable(
"user_client",