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>().default({}), /** Preferences: theme, measureUnit, autoMediaSearch, showWeatherWidget и т.д. */ preferences: jsonb('preferences').$type>().default({}), /** Персонализация: systemInstructions, responseFormat и т.д. */ personalization: jsonb('personalization').$type>().default({}), createdAt: timestamp('created_at').defaultNow().notNull(), updatedAt: timestamp('updated_at').defaultNow().notNull(), });