mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-17 07:28:46 +00:00
Production 환경에서의 DB 자동 Migration 구현
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { DatabaseError } from "pg";
|
||||
import pg from "pg";
|
||||
import { IntegrityError } from "./error";
|
||||
import db from "./kysely";
|
||||
import type { HskState } from "./schema";
|
||||
@@ -40,7 +40,7 @@ export const registerInitialHsk = async (
|
||||
})
|
||||
.execute();
|
||||
} catch (e) {
|
||||
if (e instanceof DatabaseError && e.code === "23505") {
|
||||
if (e instanceof pg.DatabaseError && e.code === "23505") {
|
||||
throw new IntegrityError("HSK already registered");
|
||||
}
|
||||
throw e;
|
||||
|
||||
Reference in New Issue
Block a user