Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 768 Bytes

POSTGRES.md

File metadata and controls

30 lines (19 loc) · 768 Bytes

Postgres Instructions

Getting a database dump

Use pg_dump in "schema-only" mode:

pg_dump --dbname=$dbname --host=$host --port=$port --no-owner --no-privileges --schema-only --no-security-labels

Write to a file named schema.sql.

Recompile the datamodels

You'll need Postgres installed locally with psql in your $PATH and the prisma-render CLI in your $PATH.

Then run:

git clone https://github.com/prisma/database-schema-examples
cd database-schema-examples
make

If you don't have Postgres installed locally or you want to load these schemas into a remote Postgres instance, you can use the environment variable PG_URL=postgres://

PG_URL=postgres://... make