feat: prepare TypeORM support for Postgres db calls
This commit is contained in:
31
src/entities/Link.ts
Normal file
31
src/entities/Link.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinTable } from "typeorm"
|
||||
import { User } from "./User"
|
||||
|
||||
@Entity("links")
|
||||
export class Link {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column({ nullable: true })
|
||||
subdomain: string
|
||||
|
||||
@Column()
|
||||
shortUri: string
|
||||
|
||||
@Column()
|
||||
fullUrl: string
|
||||
|
||||
@Column()
|
||||
role: string
|
||||
|
||||
@Column('bigint')
|
||||
createDate: number
|
||||
|
||||
@Column('bigint')
|
||||
expiryDate: number
|
||||
|
||||
@ManyToOne(() => User, (user) => user.links)
|
||||
@JoinTable()
|
||||
author: User
|
||||
}
|
||||
Reference in New Issue
Block a user