diff --git a/package.json b/package.json index 95392122a..226fa8c18 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/ormconfig.ts b/src/ormconfig.ts index bfb4c35d1..00dc7fb0b 100644 --- a/src/ormconfig.ts +++ b/src/ormconfig.ts @@ -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', // },