Skip to content

Commit

Permalink
feat: made db transaction atomic for major cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabute committed Aug 24, 2024
1 parent a80452e commit 44abca6
Show file tree
Hide file tree
Showing 32 changed files with 1,034 additions and 898 deletions.
7 changes: 6 additions & 1 deletion app/db/data-source.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { DataSource, DataSourceOptions } from 'typeorm';
import { ConfigService } from '@nestjs/config';
import * as dotenv from 'dotenv';

// Load .env file manually
dotenv.config();

const config = new ConfigService();

Expand All @@ -9,10 +13,11 @@ export const dataSrouceOptions: DataSourceOptions = {
host: config.get('DB_HOST'),
port: parseInt(config.get('DB_PORT') as string),
username: config.get('DB_USER'),
password: config.get('DB_PASSWORD') as string,
password: config.get('DB_PASSWORD'),
entities: ['dist/**/*.entity.js'],
migrations: ['dist/db/migrations/*.js'],
};

const dataSource = new DataSource(dataSrouceOptions);

export default dataSource;
54 changes: 0 additions & 54 deletions app/db/migrations/1724278857374-initial_table.ts

This file was deleted.

76 changes: 0 additions & 76 deletions app/db/migrations/1724285282196-initial_table.ts

This file was deleted.

16 changes: 0 additions & 16 deletions app/db/migrations/1724317920258-user_account.ts

This file was deleted.

Loading

0 comments on commit 44abca6

Please sign in to comment.