mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-18 18:25:28 +10:00
55 lines
993 B
TypeScript
55 lines
993 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
Unique,
|
|
ManyToOne,
|
|
JoinColumn
|
|
} from "typeorm"
|
|
import {System} from "./System";
|
|
|
|
@Entity({name: "Member", synchronize: true})
|
|
@Unique("UQ_Member_userid_name", ['userid', 'name'])
|
|
export class Member {
|
|
|
|
@PrimaryGeneratedColumn()
|
|
id: number
|
|
|
|
@Column()
|
|
userid: string
|
|
|
|
@ManyToOne(() => System, (system) => system.id, {eager: true, orphanedRowAction: "delete"})
|
|
@JoinColumn({ name: "systemid" })
|
|
system: System
|
|
|
|
@Column({
|
|
length: 100
|
|
})
|
|
name: string
|
|
|
|
@Column({
|
|
type: "varchar",
|
|
nullable: true,
|
|
length: 100
|
|
})
|
|
displayname: string
|
|
|
|
@Column({
|
|
nullable: true,
|
|
})
|
|
proxy: string
|
|
|
|
@Column({
|
|
nullable: true,
|
|
})
|
|
propic: string
|
|
|
|
@CreateDateColumn({ type: 'timestamptz' })
|
|
createdAt: Date
|
|
|
|
@UpdateDateColumn({ type: 'timestamptz' })
|
|
updatedAt: Date
|
|
}
|