From d6d3bbc55a557acde7d1f07c3bd4813e367d4e86 Mon Sep 17 00:00:00 2001 From: 0-Zz-ang Date: Thu, 25 Sep 2025 15:57:18 +0900 Subject: (박서영)동의관련 언어설정 추가 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema/consent.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'db') diff --git a/db/schema/consent.ts b/db/schema/consent.ts index a02d5575..c67f4b7d 100644 --- a/db/schema/consent.ts +++ b/db/schema/consent.ts @@ -38,6 +38,7 @@ import { users } from "./users"; export const policyVersions = pgTable("policy_versions", { id: integer("id").primaryKey().generatedAlwaysAsIdentity(), policyType: policyTypeEnum("policy_type").notNull(), + locale: varchar("locale", { length: 10 }).notNull(), // ko, en version: varchar("version", { length: 20 }).notNull(), content: text("content").notNull(), effectiveDate: timestamp("effective_date", { withTimezone: true }).notNull(), @@ -47,12 +48,12 @@ import { users } from "./users"; .notNull(), }, (table) => { return { - // 정책 타입과 버전의 유니크 조합 - policyVersionUniqueIdx: uniqueIndex("policy_versions_type_version_idx") - .on(table.policyType, table.version), - // 현재 버전 조회용 인덱스 + // 정책 타입, locale, 버전의 유니크 조합 + policyVersionUniqueIdx: uniqueIndex("policy_versions_type_locale_version_idx") + .on(table.policyType, table.locale, table.version), + // 현재 버전 조회용 인덱스 (locale 포함) currentPolicyIdx: index("policy_versions_current_idx") - .on(table.isCurrent), + .on(table.isCurrent, table.locale), // 효력 발생일 인덱스 effectiveDateIdx: index("policy_versions_effective_date_idx") .on(table.effectiveDate), -- cgit v1.2.3