Поправил поярдок импортов

This commit is contained in:
Dhaverd 2026-05-10 13:44:05 +08:00
parent 78ffc9a19f
commit 0f76e60cbb

View File

@ -11,15 +11,19 @@ import { SequelizeModule } from '@nestjs/sequelize';
envFilePath: ['.env.local', '.env'], envFilePath: ['.env.local', '.env'],
isGlobal: true, isGlobal: true,
}), }),
SequelizeModule.forRoot({ SequelizeModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
dialect: 'mysql', dialect: 'mysql',
host: process.env.DB_HOST, host: configService.get<string>('DB_HOST'),
port: Number(process.env.DB_PORT), port: configService.get<number>('DB_PORT'),
username: process.env.DB_USER, username: configService.get<string>('DB_USER'),
password: process.env.DB_PASS, password: configService.get<string>('DB_PASS'),
database: process.env.DB_NAME, database: configService.get<string>('DB_NAME'),
autoLoadModels: true, autoLoadModels: true,
synchronize: false, synchronize: true, // Включите обратно для синхронизации
}),
}), }),
BlacklistModule, BlacklistModule,
], ],