Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.12 KB

GUIDE_DATABASE.md

File metadata and controls

62 lines (41 loc) · 1.12 KB

Guide: Database

Follow this if want to run the database in a local container with Docker and Docker Compose.

Docker

Install and setup Docker on your system.

Docker Compose

Setup .env to and change them as needed:

Start Docker service.

Run Docker Compose up.

docker-compose up

If everything is fine, exit and run it again in detached mode.

docker-compose up -d

Push the schema to it.

pnpm db:push

Seed initial data

pnpm db:seed

Note: Only need to push the schema in development. No need for migration files.

Database backup from PlanetScale

To backup using PlanetScale's pscale CLI:

pscale db dump database_name branch --output database_name.dump

For example:

pscale db dump rewinds main --output rewinds.dump