Skip to content

Commit

Permalink
feat: applicant Entity 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
Jieun1ee committed Nov 6, 2024
1 parent a931765 commit 8a2e186
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions apps/api/src/entity/applicant.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import {
Entity,
Index,
Column,
PrimaryGeneratedColumn,
ManyToOne,
JoinColumn,
CreateDateColumn,
} from 'typeorm';

import { Ticle } from './ticle.entity';
import { User } from './user.entity';

@Entity('applicant')
@Index('idx_unique_application', ['ticle_id', 'user_id'], { unique: true })
export class Applicant {
@PrimaryGeneratedColumn({ type: 'bigint' })
id: number;

@ManyToOne(() => Ticle, (ticle) => ticle.id)
@JoinColumn({ name: 'ticle_id' })
ticle: Ticle;

@ManyToOne(() => User, (user) => user.ticles)
@JoinColumn({ name: 'user_id' })
user: User;

@CreateDateColumn({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
createdAt: Date;
}

0 comments on commit 8a2e186

Please sign in to comment.