Skip to content

Commit

Permalink
migrations 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mathpaquette committed Jan 23, 2023
1 parent a6bd8fa commit 688fc0f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/dist
/coverage
/.angular

/apps/api/db
35 changes: 35 additions & 0 deletions apps/api/db/1674438358129-migration.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions apps/api/src/config/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { TaskEntity } from '../tasks/task.entity';

export const AppDataSource = new DataSource({
type: 'postgres',
host: process.env.API_DB_HOST || 'localhost',
port: Number(process.env.API_DB_PORT) || 5432,
username: process.env.API_DB_USERNAME || 'tskmgr',
password: process.env.API_DB_PASSWORD || 'tskmgr',
database: process.env.API_DB_DATABASE || 'tskmgr',
host: process.env.DB_HOST || 'localhost',
port: Number(process.env.DB_PORT) || 5432,
username: process.env.DB_USERNAME || 'tskmgr',
password: process.env.DB_PASSWORD || 'tskmgr',
database: process.env.DB_DATABASE || 'tskmgr',
synchronize: false,
logging: false,
entities: [FileEntity, RunEntity, TaskEntity],
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"start:dev": "nx run-many --target=serve --projects=frontend,api",
"build": "nx build",
"test": "nx test",
"postinstall": "ngcc --properties es2020 browser module main"
"postinstall": "ngcc --properties es2020 browser module main",
"typeorm": "TS_NODE_PROJECT=apps/api/tsconfig.app.json node --require ts-node/register --require tsconfig-paths/register ./node_modules/typeorm/cli.js",
"typeorm:generate": "npm run typeorm -- migration:generate -d apps/api/src/config/data-source.ts -o apps/api/db/migration"
},
"private": true,
"dependencies": {
Expand Down

0 comments on commit 688fc0f

Please sign in to comment.