Skip to content

Commit

Permalink
feat(docs): add package scripts in drizzle recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
tszhong0411 committed Feb 6, 2025
1 parent 6b2b515 commit f9226cc
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions apps/docs/src/content/recipes/drizzle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: Initialize Drizzle in your app

```bash
pnpm add drizzle-orm pg dotenv server-only
pnpm add -D drizzle-kit @types/pg
pnpm add -D drizzle-kit @types/pg dotenv-cli
```

## 2. .env
Expand Down Expand Up @@ -154,7 +154,22 @@ export const usersTable = pgTable('users', {
export * from './users'
```

## 7. Apply Migrations
## 7. Add scripts to `package.json`

```json title='package.json'
{
"scripts": {
"db:check": "pnpm with-env drizzle-kit check",
"db:generate": "pnpm with-env drizzle-kit generate",
"db:migrate": "pnpm with-env drizzle-kit migrate",
"db:push": "pnpm with-env drizzle-kit push",
"db:studio": "pnpm with-env drizzle-kit studio",
"with-env": "dotenv -e .env.local --"
}
}
```

## 8. Apply Migrations

```bash
pnpm db:generate
Expand Down

0 comments on commit f9226cc

Please sign in to comment.