feat: add UI components for alert dialog, badge, checkbox, dialog, label, select, sheet, table, textarea
- 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.
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the `RomFile` table. If the table is not empty, all the data it contains will be lost.
|
||||
- You are about to drop the column `extra` on the `Game` table. All the data in the column will be lost.
|
||||
- Added the required column `source` to the `Game` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- DropIndex
|
||||
DROP INDEX "RomFile_checksum_idx";
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX "RomFile_checksum_key";
|
||||
|
||||
-- DropTable
|
||||
PRAGMA foreign_keys=off;
|
||||
DROP TABLE "RomFile";
|
||||
PRAGMA foreign_keys=on;
|
||||
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_Game" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"title" TEXT NOT NULL,
|
||||
"slug" TEXT NOT NULL,
|
||||
"description" TEXT,
|
||||
"releaseDate" DATETIME,
|
||||
"genre" TEXT,
|
||||
"platform" TEXT,
|
||||
"year" INTEGER,
|
||||
"cover" TEXT,
|
||||
"source" TEXT NOT NULL,
|
||||
"sourceId" TEXT,
|
||||
"romPath" TEXT,
|
||||
"romFilename" TEXT,
|
||||
"romSize" INTEGER,
|
||||
"romChecksum" TEXT,
|
||||
"romFormat" TEXT,
|
||||
"romHashes" TEXT,
|
||||
"igdbId" INTEGER,
|
||||
"rawgId" INTEGER,
|
||||
"thegamesdbId" INTEGER,
|
||||
"metadata" TEXT,
|
||||
"addedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"lastSeenAt" DATETIME,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
INSERT INTO "new_Game" ("createdAt", "description", "id", "igdbId", "rawgId", "releaseDate", "slug", "thegamesdbId", "title", "updatedAt") SELECT "createdAt", "description", "id", "igdbId", "rawgId", "releaseDate", "slug", "thegamesdbId", "title", "updatedAt" FROM "Game";
|
||||
DROP TABLE "Game";
|
||||
ALTER TABLE "new_Game" RENAME TO "Game";
|
||||
CREATE UNIQUE INDEX "Game_slug_key" ON "Game"("slug");
|
||||
CREATE UNIQUE INDEX "Game_igdbId_key" ON "Game"("igdbId");
|
||||
CREATE UNIQUE INDEX "Game_rawgId_key" ON "Game"("rawgId");
|
||||
CREATE UNIQUE INDEX "Game_thegamesdbId_key" ON "Game"("thegamesdbId");
|
||||
CREATE INDEX "Game_source_idx" ON "Game"("source");
|
||||
CREATE INDEX "Game_sourceId_idx" ON "Game"("sourceId");
|
||||
CREATE INDEX "Game_title_idx" ON "Game"("title");
|
||||
CREATE INDEX "Game_romChecksum_idx" ON "Game"("romChecksum");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
@@ -0,0 +1,43 @@
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_Game" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"title" TEXT NOT NULL,
|
||||
"slug" TEXT NOT NULL,
|
||||
"description" TEXT,
|
||||
"releaseDate" DATETIME,
|
||||
"genre" TEXT,
|
||||
"platform" TEXT,
|
||||
"year" INTEGER,
|
||||
"cover" TEXT,
|
||||
"source" TEXT NOT NULL DEFAULT 'manual',
|
||||
"sourceId" TEXT,
|
||||
"romPath" TEXT,
|
||||
"romFilename" TEXT,
|
||||
"romSize" INTEGER,
|
||||
"romChecksum" TEXT,
|
||||
"romFormat" TEXT,
|
||||
"romHashes" TEXT,
|
||||
"igdbId" INTEGER,
|
||||
"rawgId" INTEGER,
|
||||
"thegamesdbId" INTEGER,
|
||||
"metadata" TEXT,
|
||||
"addedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"lastSeenAt" DATETIME,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
INSERT INTO "new_Game" ("addedAt", "cover", "createdAt", "description", "genre", "id", "igdbId", "lastSeenAt", "metadata", "platform", "rawgId", "releaseDate", "romChecksum", "romFilename", "romFormat", "romHashes", "romPath", "romSize", "slug", "source", "sourceId", "thegamesdbId", "title", "updatedAt", "year") SELECT "addedAt", "cover", "createdAt", "description", "genre", "id", "igdbId", "lastSeenAt", "metadata", "platform", "rawgId", "releaseDate", "romChecksum", "romFilename", "romFormat", "romHashes", "romPath", "romSize", "slug", "source", "sourceId", "thegamesdbId", "title", "updatedAt", "year" FROM "Game";
|
||||
DROP TABLE "Game";
|
||||
ALTER TABLE "new_Game" RENAME TO "Game";
|
||||
CREATE UNIQUE INDEX "Game_slug_key" ON "Game"("slug");
|
||||
CREATE UNIQUE INDEX "Game_igdbId_key" ON "Game"("igdbId");
|
||||
CREATE UNIQUE INDEX "Game_rawgId_key" ON "Game"("rawgId");
|
||||
CREATE UNIQUE INDEX "Game_thegamesdbId_key" ON "Game"("thegamesdbId");
|
||||
CREATE INDEX "Game_source_idx" ON "Game"("source");
|
||||
CREATE INDEX "Game_sourceId_idx" ON "Game"("sourceId");
|
||||
CREATE INDEX "Game_title_idx" ON "Game"("title");
|
||||
CREATE INDEX "Game_romChecksum_idx" ON "Game"("romChecksum");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
@@ -15,19 +15,49 @@ model Game {
|
||||
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
|
||||
extra String? // JSON serialized (usar parse/stringify al guardar/leer) para compatibilidad con SQLite
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
romFiles RomFile[]
|
||||
|
||||
// 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 {
|
||||
@@ -47,22 +77,6 @@ model GamePlatform {
|
||||
@@unique([gameId, platformId])
|
||||
}
|
||||
|
||||
model RomFile {
|
||||
id String @id @default(cuid())
|
||||
path String
|
||||
filename String
|
||||
checksum String @unique
|
||||
size Int
|
||||
format String
|
||||
hashes String? // JSON serialized (ej.: {"crc32": "...", "md5": "..."})
|
||||
game Game? @relation(fields: [gameId], references: [id])
|
||||
gameId String?
|
||||
addedAt DateTime @default(now())
|
||||
lastSeenAt DateTime?
|
||||
status String @default("active")
|
||||
@@index([checksum])
|
||||
}
|
||||
|
||||
model Artwork {
|
||||
id String @id @default(cuid())
|
||||
game Game @relation(fields: [gameId], references: [id])
|
||||
@@ -104,4 +118,5 @@ model PriceHistory {
|
||||
|
||||
// Metadatos:
|
||||
// Autor: GitHub Copilot
|
||||
// Última actualización: 2026-02-07
|
||||
// Última actualización: 2026-03-18
|
||||
// Unificación de juegos y ROMs en una sola entidad Game
|
||||
|
||||
Reference in New Issue
Block a user