Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ludavidca authored Jul 26, 2024
1 parent 402366c commit 111629b
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,50 @@ SELECT * FROM <table-name>;

### Seeding the Database

Ensure the database is running locally
Local: Ensure the database is running locally

In schema.prisma, replace datasource with:
```bash
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
```

Run the following commands:
```bash
npx prisma db generate
npx prisma db push
```

```bash
# In the root directory to sync seed.ts to the current data models of the database
npx @snaplet/seed sync

# seeding the database according to seed.ts
npx prisma db seed

# check if the tables are seeded correctly
SELECT * FROM public."<Table-name>";

```

Vercel Postgres: make sure you pull the new secrets from hashicorp.

In schema.prisma, replace datasource with:
```bash
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL")
directUrl = env("POSTGRES_URL_NON_POOLING")
}
```

Run the following commands:
```bash
npx prisma db generate
npx prisma db push
```

```bash
# In the root directory to sync seed.ts to the current data models of the database
Expand All @@ -153,6 +196,7 @@ SELECT * FROM public."<Table-name>";

```


## Formatting and Linting

### Prettier
Expand Down

0 comments on commit 111629b

Please sign in to comment.