mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 10:33:40 +02:00
style: auto-format codebase with Prettier
Applied formatting to 1487+ files using pnpm format:write - TypeScript/JavaScript files - Svelte components - Astro pages - JSON configs - Markdown docs 13 files still need manual review (Astro JSX comments)
This commit is contained in:
parent
0241f5554c
commit
d36b321d9d
3952 changed files with 661498 additions and 739751 deletions
|
|
@ -1,32 +1,24 @@
|
|||
import {
|
||||
pgTable,
|
||||
uuid,
|
||||
integer,
|
||||
decimal,
|
||||
date,
|
||||
timestamp,
|
||||
index,
|
||||
} from 'drizzle-orm/pg-core';
|
||||
import { pgTable, uuid, integer, decimal, date, timestamp, index } from 'drizzle-orm/pg-core';
|
||||
|
||||
export const userStats = pgTable(
|
||||
'user_stats',
|
||||
{
|
||||
userId: uuid('user_id').primaryKey(),
|
||||
totalWins: integer('total_wins').default(0).notNull(),
|
||||
totalSessions: integer('total_sessions').default(0).notNull(),
|
||||
totalCardsStudied: integer('total_cards_studied').default(0).notNull(),
|
||||
totalTimeSeconds: integer('total_time_seconds').default(0).notNull(),
|
||||
averageAccuracy: decimal('average_accuracy', { precision: 5, scale: 2 }).default('0').notNull(),
|
||||
streakDays: integer('streak_days').default(0).notNull(),
|
||||
longestStreak: integer('longest_streak').default(0).notNull(),
|
||||
lastStudyDate: date('last_study_date'),
|
||||
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
},
|
||||
(table) => [
|
||||
index('idx_user_stats_total_wins').on(table.totalWins),
|
||||
index('idx_user_stats_streak_days').on(table.streakDays),
|
||||
]
|
||||
'user_stats',
|
||||
{
|
||||
userId: uuid('user_id').primaryKey(),
|
||||
totalWins: integer('total_wins').default(0).notNull(),
|
||||
totalSessions: integer('total_sessions').default(0).notNull(),
|
||||
totalCardsStudied: integer('total_cards_studied').default(0).notNull(),
|
||||
totalTimeSeconds: integer('total_time_seconds').default(0).notNull(),
|
||||
averageAccuracy: decimal('average_accuracy', { precision: 5, scale: 2 }).default('0').notNull(),
|
||||
streakDays: integer('streak_days').default(0).notNull(),
|
||||
longestStreak: integer('longest_streak').default(0).notNull(),
|
||||
lastStudyDate: date('last_study_date'),
|
||||
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
},
|
||||
(table) => [
|
||||
index('idx_user_stats_total_wins').on(table.totalWins),
|
||||
index('idx_user_stats_streak_days').on(table.streakDays),
|
||||
]
|
||||
);
|
||||
|
||||
export type UserStats = typeof userStats.$inferSelect;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue