feat(locale): persist household and member preferences

This commit is contained in:
2026-03-09 13:17:25 +04:00
parent bebff07ee8
commit 9de6bcc31b
16 changed files with 2704 additions and 37 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE "households" ADD COLUMN "default_locale" text DEFAULT 'ru' NOT NULL;--> statement-breakpoint
ALTER TABLE "members" ADD COLUMN "preferred_locale" text;--> statement-breakpoint

File diff suppressed because it is too large Load Diff

View File

@@ -57,6 +57,13 @@
"when": 1773051000000,
"tag": "0007_sudden_murmur",
"breakpoints": true
},
{
"idx": 8,
"version": "7",
"when": 1773047624171,
"tag": "0008_lowly_spiral",
"breakpoints": true
}
]
}

View File

@@ -15,6 +15,7 @@ import {
export const households = pgTable('households', {
id: uuid('id').defaultRandom().primaryKey(),
name: text('name').notNull(),
defaultLocale: text('default_locale').default('ru').notNull(),
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull()
})
@@ -142,6 +143,7 @@ export const members = pgTable(
.references(() => households.id, { onDelete: 'cascade' }),
telegramUserId: text('telegram_user_id').notNull(),
displayName: text('display_name').notNull(),
preferredLocale: text('preferred_locale'),
isAdmin: integer('is_admin').default(0).notNull(),
joinedAt: timestamp('joined_at', { withTimezone: true }).defaultNow().notNull()
},