Files
omnivore/packages/api/src/entity/page.ts
Hongbo Wu 7569e988bf upgrade typeorm to 3.0 (#359)
* upgrade typeorm to 3.0

* use new datasource object in typeorm 3

* fix tests

* fix tests

* migrate before creating connection

* fail the test if migration failed
2022-04-06 10:32:41 +08:00

53 lines
841 B
TypeScript

import {
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm'
@Entity({ name: 'pages' })
export class Page {
@PrimaryGeneratedColumn('uuid')
id!: string
@Column('text')
url!: string
@Column('text')
hash!: string
@Column('text')
title!: string
@Column('text', { nullable: true })
uploadFileId!: string
@Column('text', { nullable: true })
author!: string
@Column('text', { nullable: true })
description!: string
@Column('text', { nullable: true })
image!: string
@Column('text')
content!: string
@Column('text', { name: 'page_type' })
type!: string
@Column('text', { nullable: true })
originalHtml!: string
@Column('timestamp')
publishedAt?: Date
@CreateDateColumn()
createdAt?: Date
@UpdateDateColumn()
updatedAt?: Date
}