Skip to content

Commit 98e7fc4

Browse files
committed
fix projectQfRound entity
1 parent c6a0bf5 commit 98e7fc4

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/entities/projectQfRound.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
import { Field, ID, ObjectType, Float, Int } from 'type-graphql';
22
import {
3-
PrimaryColumn,
3+
PrimaryGeneratedColumn,
44
Column,
55
Entity,
66
ManyToOne,
77
BaseEntity,
88
CreateDateColumn,
99
UpdateDateColumn,
1010
Index,
11+
Unique,
1112
} from 'typeorm';
1213
import { Project } from './project';
1314
import { QfRound } from './qfRound';
1415

1516
@Entity('project_qf_rounds_qf_round')
1617
@ObjectType()
18+
@Unique(['projectId', 'qfRoundId']) // Ensure uniqueness of the composite key
1719
export class ProjectQfRound extends BaseEntity {
1820
@Field(_type => ID)
19-
@Column({ generated: 'increment' })
20-
@Index()
21+
@PrimaryGeneratedColumn() // Make this the primary key
2122
id: number;
2223

2324
@Field(_type => ID)
24-
@PrimaryColumn()
25+
@Column()
26+
@Index()
2527
projectId: number;
2628

2729
@Field(_type => ID)
28-
@PrimaryColumn()
30+
@Column()
31+
@Index()
2932
qfRoundId: number;
3033

3134
@ManyToOne(_type => Project, project => project.projectQfRoundRelations)

0 commit comments

Comments
 (0)