feat add questions module and admin routes
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
Index,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
PrimaryGeneratedColumn,
|
||||
@@ -10,8 +11,10 @@ import {
|
||||
import { QuestionType } from '../enums/question-type.enum';
|
||||
import type { QuestionMetadata } from '../types/question-metadata.type';
|
||||
import { Choice } from './choice.entity';
|
||||
import { UNIQUE_TEST_ORDER_IDX } from '../constants';
|
||||
|
||||
@Entity()
|
||||
@Index(UNIQUE_TEST_ORDER_IDX, ['test', 'order'], { unique: true })
|
||||
export class Question {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
@@ -28,7 +31,7 @@ export class Question {
|
||||
})
|
||||
type!: QuestionType;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
@Column({ type: 'text', nullable: false })
|
||||
content!: string;
|
||||
|
||||
@Column({ type: 'int', nullable: false })
|
||||
|
||||
Reference in New Issue
Block a user