Files
omnivore/packages/api/src/entity/link_label.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

27 lines
476 B
TypeScript

import {
CreateDateColumn,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm'
import { Link } from './link'
import { Label } from './label'
@Entity({ name: 'link_labels' })
export class LinkLabel {
@PrimaryGeneratedColumn('uuid')
id!: string
@ManyToOne(() => Link)
@JoinColumn({ name: 'link_id' })
link!: Link
@ManyToOne(() => Label)
@JoinColumn({ name: 'label_id' })
label!: Label
@CreateDateColumn()
createdAt!: Date
}