Skip to content

Commit

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

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

@Entity('summary')
export class Summary {
@PrimaryGeneratedColumn({ type: 'bigint' })
id: number;

@Column('varchar')
name: string;

@Column('varchar')
source: string;

@Column('varchar')
summary: string;

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

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

0 comments on commit a931765

Please sign in to comment.