feat: prepare TypeORM support for Postgres db calls
This commit is contained in:
24
src/entities/User.ts
Normal file
24
src/entities/User.ts
Normal 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[];
|
||||
}
|
||||
Reference in New Issue
Block a user