docs: database migrations
This commit is contained in:
parent
bf1729cf0d
commit
92787448bb
19
README.md
19
README.md
@ -1,7 +1,12 @@
|
||||
# Wikipedia Game Solver
|
||||
|
||||
> \[!IMPORTANT\]
|
||||
> This project is a work in progress, at an early stage of development.
|
||||
> The project is a work in progress, at an early stage of development.
|
||||
|
||||
> \[!NOTE\]
|
||||
> The project is also a way to learn and experiment with a clean monorepo architecture, with [Turborepo](https://turbo.build/repo), and [TypeScript](https://www.typescriptlang.org/) as the main language.
|
||||
>
|
||||
> The project setup **can be used as a template/boilerplate for new projects**.
|
||||
|
||||
## About
|
||||
|
||||
@ -11,11 +16,6 @@ The Wikipedia Game involves players competing to navigate from one [Wikipedia](h
|
||||
|
||||
Available online: <https://wikipedia-game-solver.theoludwig.fr>
|
||||
|
||||
> \[!NOTE\]
|
||||
> The project is also a way to learn and experiment with a monorepo architecture, with [Turborepo](https://turbo.build/repo), and [TypeScript](https://www.typescriptlang.org/) as the main language.
|
||||
>
|
||||
> The project setup **can be used as a template/boilerplate for new projects**.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Prerequisites
|
||||
@ -51,6 +51,9 @@ node --run dev
|
||||
# Start the development Docker services (e.g: Database)
|
||||
docker compose --file compose.dev.yaml up
|
||||
|
||||
# Database migrations
|
||||
node --run database:migrate
|
||||
|
||||
# Lint
|
||||
node --run lint:editorconfig
|
||||
node --run lint:prettier
|
||||
@ -73,6 +76,10 @@ node --run ace -- list
|
||||
```sh
|
||||
# Setup and run all the services for you
|
||||
docker compose up --build
|
||||
|
||||
# To execute database migrations
|
||||
docker compose exec wikipedia-game-solver-api sh
|
||||
node --run database:migrate
|
||||
```
|
||||
|
||||
#### Services started
|
||||
|
@ -15,6 +15,7 @@
|
||||
"ace": "node --import=tsx ./bin/console.ts",
|
||||
"tuyau": "node --run ace -- tuyau:generate && node --run ace -- tuyau:generate:openapi --destination=\".adonisjs/openapi.yaml\"",
|
||||
"build": "node --run tuyau",
|
||||
"database:migrate": "node --run ace -- migration:run",
|
||||
"test": "c8 node --import=tsx ./bin/test.ts",
|
||||
"test-shortest-paths": "node --import=tsx ./shortest-paths-tests.ts",
|
||||
"lint:eslint": "eslint . --max-warnings 0 --report-unused-disable-directives",
|
||||
|
@ -36,8 +36,6 @@ services:
|
||||
POSTGRES_DB: ${DATABASE_NAME}
|
||||
command: |
|
||||
--max_wal_size=4GB
|
||||
ports:
|
||||
- "${DATABASE_PORT-5432}:${DATABASE_PORT-5432}"
|
||||
volumes:
|
||||
- "wikipedia-solver-postgres-data:/var/lib/postgresql/data"
|
||||
- "./data:/data/"
|
||||
|
@ -11,6 +11,7 @@
|
||||
"scripts": {
|
||||
"dev": "turbo run dev --parallel",
|
||||
"start": "turbo run start --parallel",
|
||||
"database:migrate": "turbo run database:migrate",
|
||||
"build": "turbo run build",
|
||||
"test": "turbo run test",
|
||||
"lint:editorconfig": "editorconfig-checker",
|
||||
|
@ -31,6 +31,9 @@
|
||||
"start": {
|
||||
"dependsOn": ["build"],
|
||||
"persistent": true
|
||||
},
|
||||
"database:migrate": {
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user