mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-26 02:44:38 +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,12 +1,12 @@
|
|||
import {
|
||||
pgTable,
|
||||
uuid,
|
||||
varchar,
|
||||
text,
|
||||
boolean,
|
||||
timestamp,
|
||||
jsonb,
|
||||
index,
|
||||
pgTable,
|
||||
uuid,
|
||||
varchar,
|
||||
text,
|
||||
boolean,
|
||||
timestamp,
|
||||
jsonb,
|
||||
index,
|
||||
} from 'drizzle-orm/pg-core';
|
||||
import { relations } from 'drizzle-orm';
|
||||
import { cards } from './cards.js';
|
||||
|
|
@ -14,34 +14,34 @@ import { studySessions } from './studySessions.js';
|
|||
import { aiGenerations } from './aiGenerations.js';
|
||||
|
||||
export const decks = pgTable(
|
||||
'decks',
|
||||
{
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id').notNull(),
|
||||
title: varchar('title', { length: 255 }).notNull(),
|
||||
description: text('description'),
|
||||
coverImageUrl: text('cover_image_url'),
|
||||
isPublic: boolean('is_public').default(false).notNull(),
|
||||
isFeatured: boolean('is_featured').default(false).notNull(),
|
||||
featuredAt: timestamp('featured_at', { withTimezone: true }),
|
||||
settings: jsonb('settings').default({}).$type<Record<string, unknown>>(),
|
||||
tags: text('tags').array().default([]),
|
||||
metadata: jsonb('metadata').default({}).$type<Record<string, unknown>>(),
|
||||
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
},
|
||||
(table) => [
|
||||
index('idx_decks_user_id').on(table.userId),
|
||||
index('idx_decks_is_public').on(table.isPublic),
|
||||
index('idx_decks_is_featured').on(table.isFeatured),
|
||||
index('idx_decks_updated_at').on(table.updatedAt),
|
||||
]
|
||||
'decks',
|
||||
{
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id').notNull(),
|
||||
title: varchar('title', { length: 255 }).notNull(),
|
||||
description: text('description'),
|
||||
coverImageUrl: text('cover_image_url'),
|
||||
isPublic: boolean('is_public').default(false).notNull(),
|
||||
isFeatured: boolean('is_featured').default(false).notNull(),
|
||||
featuredAt: timestamp('featured_at', { withTimezone: true }),
|
||||
settings: jsonb('settings').default({}).$type<Record<string, unknown>>(),
|
||||
tags: text('tags').array().default([]),
|
||||
metadata: jsonb('metadata').default({}).$type<Record<string, unknown>>(),
|
||||
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),
|
||||
},
|
||||
(table) => [
|
||||
index('idx_decks_user_id').on(table.userId),
|
||||
index('idx_decks_is_public').on(table.isPublic),
|
||||
index('idx_decks_is_featured').on(table.isFeatured),
|
||||
index('idx_decks_updated_at').on(table.updatedAt),
|
||||
]
|
||||
);
|
||||
|
||||
export const decksRelations = relations(decks, ({ many }) => ({
|
||||
cards: many(cards),
|
||||
studySessions: many(studySessions),
|
||||
aiGenerations: many(aiGenerations),
|
||||
cards: many(cards),
|
||||
studySessions: many(studySessions),
|
||||
aiGenerations: many(aiGenerations),
|
||||
}));
|
||||
|
||||
export type Deck = typeof decks.$inferSelect;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue