25 lines
391 B
TypeScript
25 lines
391 B
TypeScript
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[];
|
|
}
|