* 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
27 lines
476 B
TypeScript
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
|
|
}
|