- Implemented AlertDialog component with overlay, content, header, footer, title, description, action, and cancel functionalities. - Created Badge component with variant support for different styles. - Developed Checkbox component with custom styling and indicator. - Added Dialog component with trigger, close, overlay, content, header, footer, title, and description. - Introduced Label component for form elements. - Built Select component with trigger, content, group, item, label, separator, and scroll buttons. - Created Sheet component with trigger, close, overlay, content, header, footer, title, and description. - Implemented Table component with header, body, footer, row, head, cell, and caption. - Added Textarea component with custom styling. - Established API service for game management with CRUD operations and metadata search functionalities. - Updated dependencies in package lock files.
123 lines
3.3 KiB
Plaintext
123 lines
3.3 KiB
Plaintext
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
// Para entornos Yarn PnP/Workspaces generamos el cliente en el workspace raíz
|
|
// para que `@prisma/client` lo encuentre en `/.prisma/client`.
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
model Game {
|
|
id String @id @default(cuid())
|
|
title String
|
|
slug String @unique
|
|
description String?
|
|
releaseDate DateTime?
|
|
genre String?
|
|
platform String?
|
|
year Int?
|
|
cover String?
|
|
|
|
// Fuente del juego
|
|
source String @default("manual") // "rom", "manual", "igdb", "rawg", "thegamesdb", etc.
|
|
sourceId String? // ID en la fuente externa (para igdb, rawg, etc.)
|
|
|
|
// Datos específicos de ROM (si source = "rom")
|
|
romPath String?
|
|
romFilename String?
|
|
romSize Int?
|
|
romChecksum String?
|
|
romFormat String?
|
|
romHashes String? // JSON serialized (ej.: {"crc32": "...", "md5": "...", "sha1": "..."})
|
|
|
|
// IDs de integraciones externas (mantener compatibilidad con datos existentes)
|
|
igdbId Int? @unique
|
|
rawgId Int? @unique
|
|
thegamesdbId Int? @unique
|
|
|
|
// Metadatos adicionales de integraciones
|
|
metadata String? // JSON serialized para datos adicionales de la fuente
|
|
|
|
// Relaciones existentes
|
|
artworks Artwork[]
|
|
purchases Purchase[]
|
|
gamePlatforms GamePlatform[]
|
|
priceHistories PriceHistory[]
|
|
tags Tag[]
|
|
|
|
// Timestamps de ROM (para compatibilidad)
|
|
addedAt DateTime @default(now())
|
|
lastSeenAt DateTime?
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@index([source])
|
|
@@index([sourceId])
|
|
@@index([title])
|
|
@@index([romChecksum])
|
|
}
|
|
|
|
model Platform {
|
|
id String @id @default(cuid())
|
|
name String
|
|
slug String @unique
|
|
generation Int?
|
|
gamePlatforms GamePlatform[]
|
|
}
|
|
|
|
model GamePlatform {
|
|
id String @id @default(cuid())
|
|
game Game @relation(fields: [gameId], references: [id])
|
|
gameId String
|
|
platform Platform @relation(fields: [platformId], references: [id])
|
|
platformId String
|
|
@@unique([gameId, platformId])
|
|
}
|
|
|
|
model Artwork {
|
|
id String @id @default(cuid())
|
|
game Game @relation(fields: [gameId], references: [id])
|
|
gameId String
|
|
type String
|
|
sourceUrl String
|
|
localPath String?
|
|
width Int?
|
|
height Int?
|
|
fetchedAt DateTime @default(now())
|
|
}
|
|
|
|
model Purchase {
|
|
id String @id @default(cuid())
|
|
game Game @relation(fields: [gameId], references: [id])
|
|
gameId String
|
|
priceCents Int
|
|
currency String
|
|
store String?
|
|
date DateTime
|
|
receiptPath String?
|
|
}
|
|
|
|
model Tag {
|
|
id String @id @default(cuid())
|
|
name String @unique
|
|
games Game[]
|
|
}
|
|
|
|
model PriceHistory {
|
|
id String @id @default(cuid())
|
|
game Game @relation(fields: [gameId], references: [id])
|
|
gameId String
|
|
priceCents Int
|
|
currency String
|
|
recordedAt DateTime @default(now())
|
|
source String?
|
|
}
|
|
|
|
// Metadatos:
|
|
// Autor: GitHub Copilot
|
|
// Última actualización: 2026-03-18
|
|
// Unificación de juegos y ROMs en una sola entidad Game
|