diff options
| author | 0-Zz-ang <s1998319@gmail.com> | 2025-09-25 15:57:18 +0900 |
|---|---|---|
| committer | 0-Zz-ang <s1998319@gmail.com> | 2025-09-25 15:57:18 +0900 |
| commit | d6d3bbc55a557acde7d1f07c3bd4813e367d4e86 (patch) | |
| tree | db94f330abda7fee103c050fea3e880309bcef98 /db/schema/consent.ts | |
| parent | 4c2d4c235bd80368e31cae9c375e9a585f6a6844 (diff) | |
(박서영)동의관련 언어설정 추가
Diffstat (limited to 'db/schema/consent.ts')
| -rw-r--r-- | db/schema/consent.ts | 11 |
1 files changed, 6 insertions, 5 deletions
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), |
