DB 마이그레이션 스크립트 재생성 및 간단한 이미지/비디오 뷰어 구현

This commit is contained in:
static
2025-01-06 22:55:11 +09:00
parent 3168c441b9
commit 1c06a604c5
15 changed files with 111 additions and 16 deletions

View File

@@ -21,6 +21,7 @@ export interface NewFileParams {
mekVersion: number;
encDek: string;
dekVersion: Date;
contentType: string;
encContentIv: string;
encName: string;
encNameIv: string;
@@ -137,6 +138,7 @@ export const registerNewFile = async (params: NewFileParams) => {
createdAt: now,
userId: params.userId,
mekVersion: params.mekVersion,
contentType: params.contentType,
encDek: params.encDek,
dekVersion: params.dekVersion,
encContentIv: params.encContentIv,

View File

@@ -47,6 +47,7 @@ export const file = sqliteTable(
mekVersion: integer("master_encryption_key_version").notNull(),
encDek: text("encrypted_data_encryption_key").notNull().unique(), // Base64
dekVersion: integer("data_encryption_key_version", { mode: "timestamp_ms" }).notNull(),
contentType: text("content_type").notNull(),
encContentIv: text("encrypted_content_iv").notNull(), // Base64
encName: ciphertext("encrypted_name").notNull(),
},