Add migration commands to justfile and update package.json for database management
- Introduced new commands in justfile for creating and running database migrations. - Updated package.json to include migration-related scripts for easier database management. - Added a new migrations index file to facilitate future migration implementations.
This commit is contained in:
parent
6abfa41ef1
commit
f864f85a18
@ -10,7 +10,10 @@
|
|||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"clean": "rm -rf .next .turbo node_modules",
|
"clean": "rm -rf .next .turbo node_modules",
|
||||||
"generate:types": "payload generate:types"
|
"generate:types": "payload generate:types",
|
||||||
|
"payload": "payload",
|
||||||
|
"migrate:create": "payload migrate:create",
|
||||||
|
"ci": "payload migrate && next build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@advdoors/shared": "workspace:*",
|
"@advdoors/shared": "workspace:*",
|
||||||
|
|||||||
1
apps/web/src/migrations/index.ts
Normal file
1
apps/web/src/migrations/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const migrations = [];
|
||||||
@ -6,6 +6,7 @@ import { lexicalEditor } from "@payloadcms/richtext-lexical";
|
|||||||
import { s3Storage } from "@payloadcms/storage-s3";
|
import { s3Storage } from "@payloadcms/storage-s3";
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
|
|
||||||
|
import { migrations } from "./migrations";
|
||||||
import { Products } from "./collections/Products";
|
import { Products } from "./collections/Products";
|
||||||
import { Categories } from "./collections/Categories";
|
import { Categories } from "./collections/Categories";
|
||||||
import { Orders } from "./collections/Orders";
|
import { Orders } from "./collections/Orders";
|
||||||
@ -43,6 +44,7 @@ export default buildConfig({
|
|||||||
pool: {
|
pool: {
|
||||||
connectionString: process.env.DATABASE_URI || "",
|
connectionString: process.env.DATABASE_URI || "",
|
||||||
},
|
},
|
||||||
|
prodMigrations: migrations,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
sharp,
|
sharp,
|
||||||
|
|||||||
8
justfile
8
justfile
@ -58,6 +58,14 @@ llm-process:
|
|||||||
import-processed:
|
import-processed:
|
||||||
pnpm --filter @advdoors/scraper import:processed
|
pnpm --filter @advdoors/scraper import:processed
|
||||||
|
|
||||||
|
# Create a new database migration (requires dev services running)
|
||||||
|
migrate-create:
|
||||||
|
pnpm --filter @advdoors/web migrate:create
|
||||||
|
|
||||||
|
# Run pending migrations against dev database
|
||||||
|
migrate:
|
||||||
|
pnpm --filter @advdoors/web payload migrate
|
||||||
|
|
||||||
# Build all packages
|
# Build all packages
|
||||||
build:
|
build:
|
||||||
pnpm turbo build
|
pnpm turbo build
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user