TypeORM-readme-17.ts
· 305 B · TypeScript
Неформатований
import { Entity, Column, PrimaryColumn } from "typeorm"
@Entity()
export class Photo {
@PrimaryColumn()
id: number
@Column()
name: string
@Column()
description: string
@Column()
filename: string
@Column()
views: number
@Column()
isPublished: boolean
}
1 | import { Entity, Column, PrimaryColumn } from "typeorm" |
2 | |
3 | @Entity() |
4 | export class Photo { |
5 | @PrimaryColumn() |
6 | id: number |
7 | |
8 | @Column() |
9 | name: string |
10 | |
11 | @Column() |
12 | description: string |
13 | |
14 | @Column() |
15 | filename: string |
16 | |
17 | @Column() |
18 | views: number |
19 | |
20 | @Column() |
21 | isPublished: boolean |
22 | } |