chore: update Prisma and dependencies, add initial migration and tests
- Updated Prisma and @prisma/client to version 6.19.2 in package.json and yarn.lock. - Added package extensions for @prisma/client in .yarnrc.yml. - Updated backend README.md for clearer setup instructions. - Created initial migration for Game, Platform, and related tables in Prisma. - Added migration lock file for version control. - Implemented tests for Game model using Vitest, including creation and unique slug constraint checks.
This commit is contained in:
@@ -2,31 +2,34 @@
|
||||
|
||||
Scaffold mínimo del backend usando Fastify + TypeScript + Prisma (SQLite).
|
||||
|
||||
Pasos rápidos:
|
||||
**Arranque rápido**
|
||||
|
||||
1. Instalar dependencias:
|
||||
```
|
||||
# desde la raíz
|
||||
yarn
|
||||
|
||||
yarn
|
||||
# entrar al backend
|
||||
cd backend
|
||||
|
||||
2. Generar el cliente Prisma:
|
||||
# generar cliente Prisma
|
||||
yarn prisma:generate
|
||||
|
||||
npx prisma generate
|
||||
# aplicar migraciones (si pide nombre, usar --name init)
|
||||
yarn prisma:migrate
|
||||
|
||||
3. Crear la migración inicial (local):
|
||||
# abrir Prisma Studio
|
||||
yarn prisma:studio
|
||||
|
||||
npx prisma migrate dev --name init
|
||||
# ejecutar en desarrollo
|
||||
yarn dev
|
||||
|
||||
4. Ejecutar en modo desarrollo:
|
||||
|
||||
yarn dev
|
||||
|
||||
5. Tests:
|
||||
|
||||
yarn test
|
||||
# ejecutar tests
|
||||
yarn test
|
||||
```
|
||||
|
||||
Notas:
|
||||
|
||||
- Las migraciones **no** se ejecutaron como parte de este commit. Use `.env.example` como referencia para `DATABASE_URL`.
|
||||
- Use `.env.example` como referencia para `DATABASE_URL`.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user