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

24
src/entities/User.ts Normal file
View File

@@ -0,0 +1,24 @@
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm"
import { Link } from "./Link"
@Entity("users")
export class User {
@PrimaryGeneratedColumn()
id: number
@Column({ unique: true })
name: string
@Column()
passwordHash: string
@Column()
role: string
@Column('bigint')
createdAt: number
@OneToMany(() => Link, (link) => link.author)
links: Link[];
}