20 lines
602 B
TypeScript
20 lines
602 B
TypeScript
import { Pregunta } from 'src/pregunta/entities/pregunta.entity';
|
|
import { Seccion } from 'src/seccion/entities/seccion.entity';
|
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
|
|
|
@Entity()
|
|
export class SeccionPregunta {
|
|
@PrimaryGeneratedColumn()
|
|
id_seccion_pregunta: number;
|
|
|
|
@Column()
|
|
posicion: number;
|
|
|
|
@ManyToOne(() => Seccion, seccion => seccion.seccion_pregunta)
|
|
@JoinColumn({name:'id_seccion'})
|
|
seccion: Seccion;
|
|
|
|
@ManyToOne(() => Pregunta, pregunta => pregunta.seccionesPregunta)
|
|
@JoinColumn({name:'id_pregunta'})
|
|
pregunta: Pregunta;
|
|
} |