add entities for db
This commit is contained in:
+34
-2
@@ -3,9 +3,41 @@ import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { AuthModule } from './auth/auth.module';
|
||||
import { UsersModule } from './users/users.module';
|
||||
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { config } from 'dotenv';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { Carrera } from './entities/carreras.entity';
|
||||
import { ComentarioEje } from './entities/comentarioEjes.entity';
|
||||
import { EjeEstrategico } from './entities/ejesEstrategicos.entity';
|
||||
import { LineaProgramatica } from './entities/LineaProgramatica.entity';
|
||||
import { TipoUsuarioEntity } from './entities/tipoUsuario.entity';
|
||||
import { UsuarioEntity } from './entities/usuario.entity';
|
||||
config({ path: '.env' });
|
||||
@Module({
|
||||
imports: [AuthModule, UsersModule],
|
||||
imports: [
|
||||
AuthModule,
|
||||
UsersModule,
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
}),
|
||||
TypeOrmModule.forRoot({
|
||||
type: 'mysql',
|
||||
host: process.env.DB_HOST,
|
||||
port: parseInt(process.env.DB_PORT),
|
||||
username: process.env.DB_USERNAME,
|
||||
password: process.env.DB_PASSWORD,
|
||||
database: process.env.DB_NAME,
|
||||
synchronize: true,
|
||||
entities: [
|
||||
Carrera,
|
||||
ComentarioEje,
|
||||
EjeEstrategico,
|
||||
LineaProgramatica,
|
||||
TipoUsuarioEntity,
|
||||
UsuarioEntity,
|
||||
],
|
||||
}),
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user