feat: prepare TypeORM support for Postgres db calls

This commit is contained in:
2025-12-01 01:48:24 +01:00
parent 7dd1025aef
commit 56975a0e92
12 changed files with 2970 additions and 0 deletions

31
src/entities/Link.ts Normal file
View 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
}