Add an auth:migrate npm script for Better Auth's own migrations
Installs @better-auth/cli as a devDependency instead of fetching it via npx each time, and updates the README to use the new script. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,7 +50,7 @@ etc). A `docker-compose.yml` at the repo root starts one:
|
|||||||
docker compose up -d # starts Postgres on localhost:5433
|
docker compose up -d # starts Postgres on localhost:5433
|
||||||
cp .env.example .env.local # sets DATABASE_URL to match
|
cp .env.example .env.local # sets DATABASE_URL to match
|
||||||
npm run db:migrate # applies this project's Drizzle migrations
|
npm run db:migrate # applies this project's Drizzle migrations
|
||||||
npx @better-auth/cli migrate # applies Better Auth's own tables
|
npm run auth:migrate # applies Better Auth's own tables
|
||||||
npm run db:seed # seeds a sample Brand, menu, and Machines
|
npm run db:seed # seeds a sample Brand, menu, and Machines
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
@@ -72,7 +72,7 @@ Generate and set the `BETTER_AUTH_SECRET` environment variable in your
|
|||||||
`.env.local`:
|
`.env.local`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx -y @better-auth/cli secret
|
npx @better-auth/cli secret
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [Better Auth documentation](https://www.better-auth.com) for more on
|
See the [Better Auth documentation](https://www.better-auth.com) for more on
|
||||||
|
|||||||
Generated
+1425
-21
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,7 @@
|
|||||||
"db:pull": "drizzle-kit pull",
|
"db:pull": "drizzle-kit pull",
|
||||||
"db:studio": "drizzle-kit studio",
|
"db:studio": "drizzle-kit studio",
|
||||||
"db:seed": "tsx src/db/seed.ts",
|
"db:seed": "tsx src/db/seed.ts",
|
||||||
|
"auth:migrate": "better-auth migrate",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"format": "prettier --write . && eslint --fix",
|
"format": "prettier --write . && eslint --fix",
|
||||||
"check": "prettier --check .",
|
"check": "prettier --check .",
|
||||||
@@ -38,6 +39,7 @@
|
|||||||
"zod": "^4.5.4"
|
"zod": "^4.5.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@better-auth/cli": "^1.4.21",
|
||||||
"@tanstack/devtools-vite": "latest",
|
"@tanstack/devtools-vite": "latest",
|
||||||
"@tanstack/eslint-config": "latest",
|
"@tanstack/eslint-config": "latest",
|
||||||
"@tanstack/router-cli": "^1.132.0",
|
"@tanstack/router-cli": "^1.132.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user