add prod migrations and seed scripts

This commit is contained in:
Joseph Ditton 2021-12-04 20:54:26 -07:00
parent 460c4be094
commit d45d93b750

View File

@ -12,12 +12,14 @@
"db:stop": "pg_ctl status && pg_ctl stop", "db:stop": "pg_ctl status && pg_ctl stop",
"db:migration:create": "cd server/database/migrations && typeorm migration:create -n ", "db:migration:create": "cd server/database/migrations && typeorm migration:create -n ",
"db:migrate": "yarn db:start && yarn typeorm migration:run", "db:migrate": "yarn db:start && yarn typeorm migration:run",
"db:migrate:prod": "yarn typeorm migration:run",
"db:migrate:undo": "yarn db:start && yarn typeorm migration:revert", "db:migrate:undo": "yarn db:start && yarn typeorm migration:revert",
"db:seed": "yarn db:start && ts-node ./node_modules/typeorm-seeding/dist/cli.js seed -n cli_config.ts -r $(pwd)/server/database", "db:seed": "yarn db:start && ts-node ./node_modules/typeorm-seeding/dist/cli.js seed -n cli_config.ts -r $(pwd)/server/database",
"db:seed:prod": "ts-node ./node_modules/typeorm-seeding/dist/cli.js seed -n cli_config.ts -r $(pwd)/server/database",
"db:reset": "yarn db:start && yarn typeorm schema:drop && yarn db:migrate && yarn db:seed", "db:reset": "yarn db:start && yarn typeorm schema:drop && yarn db:migrate && yarn db:seed",
"db:setup": "bash bin/create_db.sh && yarn db:migrate && yarn db:seed", "db:setup": "bash bin/create_db.sh && yarn db:migrate && yarn db:seed",
"prebuild": "rimraf dist", "prebuild": "rimraf dist",
"postbuild": "yarn db:migrate && yarn db:seed", "postbuild": "yarn db:migrate:prod && yarn db:seed:prod",
"postinstall": "cd client && NODE_ENV=development yarn", "postinstall": "cd client && NODE_ENV=development yarn",
"build": "nest build && yarn client:build", "build": "nest build && yarn client:build",
"format": "prettier --write \"server/**/*.ts\" \"test/**/*.ts\"", "format": "prettier --write \"server/**/*.ts\" \"test/**/*.ts\"",