Skip to content

Commit

Permalink
chore(migrations): fix migrations and import them manually in `typeor…
Browse files Browse the repository at this point in the history
…m.config`
  • Loading branch information
Mnigos committed Mar 21, 2024
1 parent 4f9a534 commit 9100880
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 245 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
'import/resolver': {
node: {
project: './tsconfig.json',
paths: ['@modules', '@common', '@config'],
paths: ['@modules', '@common', '@config', '@migrations'],
extensions: ['.js', '.ts'],
},
typescript: {
Expand All @@ -27,6 +27,7 @@ module.exports = {
['@modules', './src/modules'],
['@common', './src/common'],
['@config', './src/config'],
['@migrations', './src/migrations'],
],
extensions: ['.ts', '.js'],
},
Expand Down
3 changes: 2 additions & 1 deletion src/config/database/typeorm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ConfigService, registerAs } from '@nestjs/config'
import { DataSource, DataSourceOptions } from 'typeorm'

import { Environment } from '@config/environment'
import { migrations } from '@migrations/all'
import { User } from '@modules/users'
import { Profile } from '@modules/profiles'
import { Album } from '@modules/albums'
Expand All @@ -24,7 +25,7 @@ export const typeOrmConfig: TypeOrmModuleOptions = {
password: configService.get(Environment.DATABASE_PASSWORD),
database: configService.get(Environment.DATABASE_NAME),
entities: [User, Profile, Album, Artist, Track, Image, History, HistoryTrack],
migrations: ['dist/migrations/*{.ts,.js}'],
migrations,
migrationsRun: true,
autoLoadEntities: true,
synchronize: false,
Expand Down
17 changes: 0 additions & 17 deletions src/migrations/1708433471554-add-album-type-column-to-album.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions src/migrations/1710778342115-add-user-relation-to-history-track.ts

This file was deleted.

31 changes: 0 additions & 31 deletions src/migrations/1710779912388-add-unique-to-external-id-column.ts

This file was deleted.

Loading

0 comments on commit 9100880

Please sign in to comment.