src/article/article.entity.ts
        
| Properties | 
| Methods | 
| author | 
| author:      | 
| Type : UserEntity | 
| Decorators : 
                                @ManyToOne(undefined, undefined) | 
| Defined in src/article/article.entity.ts:38 | 
| body | 
| body:      | 
| Type : string | 
| Decorators : 
                                @Column({default: ''}) | 
| Defined in src/article/article.entity.ts:21 | 
| comments | 
| comments:      | 
| Type : Comment[] | 
| Decorators : 
                                @OneToMany(undefined, undefined, {eager: undefined}) | 
| Defined in src/article/article.entity.ts:42 | 
| created | 
| created:      | 
| Type : Date | 
| Decorators : 
                                @Column({type: 'timestamp', default: undefined}) | 
| Defined in src/article/article.entity.ts:24 | 
| description | 
| description:      | 
| Type : string | 
| Decorators : 
                                @Column({default: ''}) | 
| Defined in src/article/article.entity.ts:18 | 
| favoriteCount | 
| favoriteCount:      | 
| Type : number | 
| Decorators : 
                                @Column({default: 0}) | 
| Defined in src/article/article.entity.ts:45 | 
| id | 
| id:      | 
| Type : number | 
| Decorators : 
                                @PrimaryGeneratedColumn() | 
| Defined in src/article/article.entity.ts:9 | 
| slug | 
| slug:      | 
| Type : string | 
| Decorators : 
                                @Column() | 
| Defined in src/article/article.entity.ts:12 | 
| tagList | 
| tagList:      | 
| Type : string[] | 
| Decorators : 
                                @Column('simple-array') | 
| Defined in src/article/article.entity.ts:35 | 
| title | 
| title:      | 
| Type : string | 
| Decorators : 
                                @Column() | 
| Defined in src/article/article.entity.ts:15 | 
| updated | 
| updated:      | 
| Type : Date | 
| Decorators : 
                                @Column({type: 'timestamp', default: undefined}) | 
| Defined in src/article/article.entity.ts:27 | 
| updateTimestamp | 
| updateTimestamp() | 
| Decorators : 
                                @BeforeUpdate() | 
| Defined in src/article/article.entity.ts:30 | 
| 
                                Returns :      void | 
import { Entity, PrimaryGeneratedColumn, Column, OneToOne, ManyToOne, OneToMany, JoinColumn, AfterUpdate, BeforeUpdate } from 'typeorm';
import { UserEntity } from '../user/user.entity';
import { Comment } from './comment.entity';
@Entity('article')
export class ArticleEntity {
  @PrimaryGeneratedColumn()
  id: number;
  @Column()
  slug: string;
  @Column()
  title: string;
  @Column({default: ''})
  description: string;
  @Column({default: ''})
  body: string;
  @Column({ type: 'timestamp', default: () => "CURRENT_TIMESTAMP"})
  created: Date;
  @Column({ type: 'timestamp', default: () => "CURRENT_TIMESTAMP"})
  updated: Date;
  @BeforeUpdate()
  updateTimestamp() {
    this.updated = new Date;
  }
  @Column('simple-array')
  tagList: string[];
  @ManyToOne(type => UserEntity, user => user.articles)
  author: UserEntity;
  @OneToMany(type => Comment, comment => comment.article, {eager: true})
  @JoinColumn()
  comments: Comment[];
  @Column({default: 0})
  favoriteCount: number;
}