se crearon todas las tablas cuestionarios
This commit is contained in:
+30
-1
@@ -1 +1,30 @@
|
||||
export class RespuestaParticipanteAbierta {}
|
||||
import { CuestionarioRespondido } from 'src/cuestionario_respondido/entities/cuestionario_respondido.entity';
|
||||
import { Pregunta } from 'src/pregunta/entities/pregunta.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
||||
|
||||
|
||||
@Entity('respuesta_participante_abierta')
|
||||
export class RespuestaParticipanteAbierta {
|
||||
@PrimaryGeneratedColumn()
|
||||
idRespuestaParticipanteAbierta: number;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
respuesta: string;
|
||||
|
||||
// Relación con CuestionarioRespondido
|
||||
@ManyToOne(
|
||||
() => CuestionarioRespondido,
|
||||
cuestionarioRespondido => cuestionarioRespondido.idCuestionarioRespondido
|
||||
)
|
||||
@JoinColumn({ name: 'id_cuestionario_respondido' })
|
||||
id_cuestionario_respondido: CuestionarioRespondido;
|
||||
|
||||
@ManyToOne(
|
||||
() => Pregunta,
|
||||
pregunta => pregunta.id_pregunta
|
||||
)
|
||||
@JoinColumn({ name: 'id_pregunta' })
|
||||
id_pregunta: Pregunta;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Seccion } from 'src/seccion/entities/seccion.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
|
||||
|
||||
|
||||
@Entity('seccion_pregunta')
|
||||
export class SeccionPregunta {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_seccion_pregunta: number;
|
||||
|
||||
@Column({ type: 'tinyint' })
|
||||
posicion: number;
|
||||
|
||||
@ManyToOne(() => Pregunta, (pregunta) => pregunta.id_pregunta)
|
||||
@Column({ type: 'int' })
|
||||
id_pregunta: number;
|
||||
|
||||
@ManyToOne(() => Seccion, (seccion) => seccion.id_seccion)
|
||||
@Column({ type: 'int' })
|
||||
id_seccion: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user