24 lines
570 B
TypeScript
24 lines
570 B
TypeScript
|
|
import {
|
||
|
|
Entity,
|
||
|
|
Column,
|
||
|
|
PrimaryGeneratedColumn,
|
||
|
|
ManyToOne,
|
||
|
|
JoinColumn,
|
||
|
|
} from 'typeorm';
|
||
|
|
import { Carrera } from '../carrera/carrera.entity';
|
||
|
|
import { Programa } from '../programa/programa.entity';
|
||
|
|
|
||
|
|
@Entity()
|
||
|
|
export class CarreraPrograma {
|
||
|
|
@PrimaryGeneratedColumn()
|
||
|
|
id_carrera_programa: number;
|
||
|
|
|
||
|
|
@ManyToOne(() => Programa, (programa) => programa.carrerasPrograma)
|
||
|
|
@JoinColumn({ name: 'id_programa' })
|
||
|
|
programa: Programa;
|
||
|
|
|
||
|
|
@ManyToOne(() => Carrera, (carrera) => carrera.carreraProgramas)
|
||
|
|
@JoinColumn({ name: 'id_carrera' })
|
||
|
|
carrera: Carrera;
|
||
|
|
}
|