Files
gooseek/services/profile-svc/src/db/schema.ts
home cd6b7857ba feat: default locale Russian, geo determines language for other countries
- localization-svc: defaultLocale ru, resolveLocale only by geo
- web-svc: DEFAULT_LOCALE ru, layout lang=ru, embeddedTranslations fallback ru
- countryToLocale: default ru when no country or unknown country

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 15:10:38 +03:00

26 lines
1.3 KiB
TypeScript

import { jsonb, pgTable, text, timestamp } from 'drizzle-orm/pg-core';
/**
* Профиль пользователя: личные данные и персонализация
* user_id — из auth-svc (better-auth)
*/
export const userProfiles = pgTable('user_profiles', {
userId: text('user_id').primaryKey(),
/** Отображаемое имя (может отличаться от auth) */
displayName: text('display_name'),
/** URL аватара */
avatarUrl: text('avatar_url'),
/** Часовой пояс (IANA, напр. Europe/Moscow) */
timezone: text('timezone'),
/** Локаль (напр. ru, en-US) */
locale: text('locale'),
/** Личные данные (расширяемые): bio, links и т.п. */
profileData: jsonb('profile_data').$type<Record<string, unknown>>().default({}),
/** Preferences: theme, measureUnit, autoMediaSearch, showWeatherWidget и т.д. */
preferences: jsonb('preferences').$type<Record<string, unknown>>().default({}),
/** Персонализация: systemInstructions, responseFormat и т.д. */
personalization: jsonb('personalization').$type<Record<string, unknown>>().default({}),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
});