AU
Size: a a a
AU
AU
AU
AU
IK
IK
AU
IK
AU
AU
AU
AU
await transactionalEntityManagerтак делаю
.createQueryBuilder()
.update(Question)
.set(question)
.where('id = :id', { id: question.id })
.execute();
YZ
AU
AU
IK
AU
@Entity('questions')
@Unique(['question', 'answers', 'hint', 'preroll_text', 'explanation_text'])
export default class Question {
@PrimaryColumn({ unique: true })
@Generated('uuid')
public id!: string;
@Column({ type: 'text', nullable: false })
public question!: string;
@Column({ default: 1, nullable: false })
public difficulty_level!: number;
@Column({ type: 'text', default: '' })
public hint!: string;
@Column({ type: 'text', default: '' })
public preroll_text!: string;
@Column({ type: 'text', default: '' })
public preroll_media!: string;
@Column({ type: 'text', default: '' })
public question_audio!: string;
@Column('simple-json')
public answers!: IAnswers;
@Column({ type: 'text', default: '' })
public explanation_text!: string;
@Column({ type: 'text', default: '' })
public explanation_media!: string;
@Column({ type: 'integer', default: 0 })
public is_open!: number;
@Column({ type: 'integer', default: 0 })
public is_close!: number;
@Column({ type: 'integer', default: 0 })
public is_bluff!: number;
@Column({ type: 'integer', default: 0 })
public is_buzz!: number;
@Column({ type: 'integer', default: 0 })
public is_fast_answer!: number;
@Column({ default: 'fr', nullable: false })
public language!: string;
@ManyToMany(
() => Topic,
(topic: Topic) => topic.questions
)
@JoinTable()
public topics!: Topic[];
@ManyToMany(
() => Player,
(player: Player) => player.questions
)
@JoinTable()
public players!: Player[];
@Column()
@CreateDateColumn()
public createdAt!: Date;
@Column()
@UpdateDateColumn()
public updatedAt!: Date;
[key: string]: any;AU
AK