mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
MEK 등록시 로그를 남기도록 변경
This commit is contained in:
@@ -9,10 +9,6 @@ export const mek = sqliteTable(
|
||||
.notNull()
|
||||
.references(() => user.id),
|
||||
version: integer("version").notNull(),
|
||||
createdBy: integer("created_by")
|
||||
.notNull()
|
||||
.references(() => client.id),
|
||||
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
||||
state: text("state", { enum: ["active", "retired", "dead"] }).notNull(),
|
||||
retiredAt: integer("retired_at", { mode: "timestamp_ms" }),
|
||||
},
|
||||
@@ -21,6 +17,26 @@ export const mek = sqliteTable(
|
||||
}),
|
||||
);
|
||||
|
||||
export const mekLog = sqliteTable(
|
||||
"master_encryption_key_log",
|
||||
{
|
||||
id: integer("id").primaryKey({ autoIncrement: true }),
|
||||
userId: integer("user_id")
|
||||
.notNull()
|
||||
.references(() => user.id),
|
||||
mekVersion: integer("master_encryption_key_version").notNull(),
|
||||
timestamp: integer("timestamp", { mode: "timestamp_ms" }).notNull(),
|
||||
action: text("action", { enum: ["create"] }).notNull(),
|
||||
actionBy: integer("action_by").references(() => client.id),
|
||||
},
|
||||
(t) => ({
|
||||
ref: foreignKey({
|
||||
columns: [t.userId, t.mekVersion],
|
||||
foreignColumns: [mek.userId, mek.version],
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
export const clientMek = sqliteTable(
|
||||
"client_master_encryption_key",
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user