actualización tablas
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { PreguntaOpcion } from 'src/pregunta_opcion/entities/pregunta_opcion.entity';
|
||||
import { SeccionPregunta } from 'src/seccion_pregunta/entities/seccion_pregunta.entity';
|
||||
import { TipoPregunta } from 'src/tipo_pregunta/entities/tipo_pregunta.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany, JoinColumn } from 'typeorm';
|
||||
|
||||
|
||||
@Entity()
|
||||
export class Pregunta {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_pregunta: number;
|
||||
|
||||
@Column()
|
||||
pregunta: string;
|
||||
|
||||
@Column({ default: 0 })
|
||||
contador_opcion: number;
|
||||
|
||||
@Column({ default: false })
|
||||
obligatoria: boolean;
|
||||
|
||||
@ManyToOne(() => TipoPregunta, tipo => tipo.preguntas)
|
||||
@JoinColumn({ name: 'id_tipo_pregunta' })
|
||||
id_tipo_pregunta: TipoPregunta;
|
||||
|
||||
@Column({ nullable: true })
|
||||
id_opcion_dependiente: number;
|
||||
|
||||
@OneToMany(() => SeccionPregunta, seccionPregunta => seccionPregunta.id_pregunta)
|
||||
seccionPreguntas: SeccionPregunta[];
|
||||
|
||||
@OneToMany(() => PreguntaOpcion, preguntaOpcion => preguntaOpcion.id_pregunta)
|
||||
opciones: PreguntaOpcion[];
|
||||
}
|
||||
Reference in New Issue
Block a user