cmabio tabla nivel a carrera
This commit is contained in:
+1
-1
@@ -45,7 +45,7 @@ import { InstitucionTipoCarrito } from './institucion-tipo-carrito/entity/instit
|
||||
import { Modulo } from './modulo/entity/modulo.entity';
|
||||
import { Motivo } from './motivo/entity/motivo.entity';
|
||||
import { Multa } from './multa/entity/multa.entity';
|
||||
import { Nivel } from './institucion-carrera/entity/nivel.entity';
|
||||
import { Nivel } from './carrera/entity/nivel.entity';
|
||||
import { Operador } from './operador/entity/operador.entity';
|
||||
import { Prestamo } from './prestamo/entity/prestamo.entity';
|
||||
import { Programa } from './programa/entity/programa.entity';
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { InstitucionCarrera } from '../../institucion-carrera/entity/institucion-carrera.entity';
|
||||
import { Nivel } from './nivel.entity';
|
||||
|
||||
@Entity()
|
||||
export class Carrera {
|
||||
@@ -12,6 +20,10 @@ export class Carrera {
|
||||
@Column({ type: String, nullable: false, length: 3 })
|
||||
clave: string;
|
||||
|
||||
@ManyToOne(() => Nivel, (nivel) => nivel.carreras)
|
||||
@JoinColumn({ name: 'id_nivel' })
|
||||
nivel: Nivel;
|
||||
|
||||
@OneToMany(
|
||||
() => InstitucionCarrera,
|
||||
(institucionCarrera) => institucionCarrera.carrera,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { InstitucionCarrera } from './institucion-carrera.entity';
|
||||
import { Carrera } from './carrera.entity';
|
||||
|
||||
@Entity()
|
||||
export class Nivel {
|
||||
@@ -13,8 +13,8 @@ export class Nivel {
|
||||
nivel: string;
|
||||
|
||||
@OneToMany(
|
||||
() => InstitucionCarrera,
|
||||
(institucionCarrera) => institucionCarrera.nivel,
|
||||
() => Carrera,
|
||||
(carrera) => carrera.nivel,
|
||||
)
|
||||
institucionesCarreras: InstitucionCarrera[];
|
||||
carreras: Carrera[];
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
import { Carrera } from '../../carrera/entity/carrera.entity';
|
||||
import { CarreraPrograma } from '../../carrera-programa/entity/carrera-programa.entity';
|
||||
import { Institucion } from '../../institucion/entity/institucion.entity';
|
||||
import { Nivel } from './nivel.entity';
|
||||
import { Usuario } from '../../usuario/entity/usuario.entity';
|
||||
|
||||
@Entity()
|
||||
@@ -24,10 +23,6 @@ export class InstitucionCarrera {
|
||||
@JoinColumn({ name: 'id_institucion' })
|
||||
institucion: Institucion;
|
||||
|
||||
@ManyToOne(() => Nivel, (nivel) => nivel.institucionesCarreras)
|
||||
@JoinColumn({ name: 'id_nivel' })
|
||||
nivel: Nivel;
|
||||
|
||||
@OneToMany(
|
||||
() => CarreraPrograma,
|
||||
(carreraPrograma) => carreraPrograma.carrera,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { InstitucionCarreraController } from './institucion-carrera.controller';
|
||||
import { InstitucionCarreraService } from './institucion-carrera.service';
|
||||
import { InstitucionCarrera } from './entity/institucion-carrera.entity';
|
||||
import { Nivel } from './entity/nivel.entity';
|
||||
import { Nivel } from '../carrera/entity/nivel.entity';
|
||||
import { InstitucionModule } from '../institucion/institucion.module';
|
||||
|
||||
@Module({
|
||||
|
||||
Reference in New Issue
Block a user