Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run migrations as js files #1725

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,16 @@
"start": "NODE_ENV=development ts-node-dev --project ./tsconfig.json --respawn ./src/index.ts",
"start:test": "NODE_ENV=development ts-node-dev --project ./tsconfig.json --respawn ./test.ts",
"serve": "pm2 startOrRestart ecosystem.config.js --node-args='--max-old-space-size=8192'",
"db:migrate:run:test": "NODE_ENV=test npx typeorm-ts-node-commonjs migration:run -d ./src/ormconfig.ts",
"db:migrate:revert:test": "NODE_ENV=test npx typeorm-ts-node-commonjs migration:revert -d ./src/ormconfig.ts",
"db:migrate:run:local": "NODE_ENV=development npx typeorm-ts-node-commonjs migration:run -d ./src/ormconfig.ts",
"db:migrate:revert:local": "NODE_ENV=development npx typeorm-ts-node-commonjs migration:revert -d ./src/ormconfig.ts",
"db:migrate:run:production": "NODE_ENV=production npx typeorm-ts-node-commonjs migration:run -d ./src/ormconfig.ts",
"db:migrate:rever:productiont": "NODE_ENV=production npx typeorm-ts-node-commonjs migration:revert -d ./src/ormconfig.ts",
"db:migrate:run:test": "NODE_ENV=test typeorm migration:run -d ./build/src/ormconfig.js",
"db:migrate:revert:test": "NODE_ENV=test typeorm migration:revert -d ./build/src/ormconfig.js",
"db:migrate:run:local": "npm run build && NODE_ENV=development typeorm migration:run -d ./build/src/ormconfig.js",
"db:migrate:revert:local": "npm run build && NODE_ENV=development typeorm migration:revert -d ./build/src/ormconfig.js",
"db:migrate:run:production": "npm run build && NODE_ENV=production typeorm migration:run -d ./build/src/ormconfig.js",
"db:migrate:revert:production": "npm run build && NODE_ENV=production typeorm migration:revert -d ./build/src/ormconfig.js",
"prettify": "prettier --write '**/*.ts*' '**/*.test.ts*'",
"db:migrate:seedToken:run": "NODE_ENV=development ts-node ./node_modules/typeorm/cli -f ./src/seedToken-ormconfig.ts migration:run",
"db:migrate:seedToken:revert": "NODE_ENV=development ts-node ./node_modules/typeorm/cli -f ./src/seedToken-ormconfig.ts migration:revert",
"build": "rm -rf ./build && tsc && mkdir ./build/config && mkdir ./build/src/server/adminJs/tabs/components && cp -r src/server/adminJs/tabs/components/* ./build/src/server/adminJs/tabs/components/ && mkdir ./build/src/utils/locales && cp -r ./src/utils/locales/* ./build/src/utils/locales/ && cp -r ./src/abi build/src/abi ",
"build": "rm -rf ./build && tsc && mkdir -p ./build/config && if [ -d config ]; then cp -r config/* ./build/config/; fi && cp -r src/server/adminJs/tabs/components ./build/src/server/adminJs/tabs/components && cp -r ./src/utils/locales ./build/src/utils/locales && cp -r ./src/abi build/src/abi",
"dev": "NODE_ENV=development node ./build/src/index.js",
"production": "NODE_ENV=production node ./build/src/index.js",
"start:docker:server": "npm run db:migrate:run:production && npm run production",
Expand Down
2 changes: 1 addition & 1 deletion src/ormconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const ormConfig: DataSourceOptions = {
password: process.env.TYPEORM_DATABASE_PASSWORD,
database: process.env.TYPEORM_DATABASE_NAME,
entities: getEntities(),
migrations: ['migration/*.ts'],
migrations: [path.join(__dirname, '../migration/*.js')],
// cli: {
// migrationsDir: 'migration',
// },
Expand Down
Loading