start create entity for proxy

This commit is contained in:
Errormacr
2023-11-24 11:06:55 +03:00
parent c76c61c23c
commit 35d771bff0
2 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
import { User } from './user.entity';
@Entity()
export class ProxyUser {
constructor(props?: Partial<ProxyUser>) {
Object.assign(this, props);
}
@PrimaryGeneratedColumn('uuid')
public uuid!: string;
@Column({ nullable: true })
public userName: string;
@Column({ nullable: true })
public description: string;
@Column({ nullable: false })
public link!: string;
@Column({ nullable: false, type: 'timestamptz' })
public connectDate!: Date;
@Column({ nullable: true })
public user_id!: string;
@OneToOne(() => User, (user) => user.id, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: true })
@JoinColumn({ name: 'user_id' })
public user: User;
}

View File

@@ -0,0 +1,31 @@
import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
import { User } from './user.entity';
@Entity()
export class Admin {
constructor(props?: Partial<Admin>) {
Object.assign(this, props);
}
@PrimaryGeneratedColumn('uuid')
public uuid!: string;
@Column({ nullable: true })
public userName: string;
@Column({ nullable: true })
public description: string;
@Column({ nullable: false })
public link!: string;
@Column({ nullable: false, type: 'timestamptz' })
public connectDate!: Date;
@Column({ nullable: true })
public user_id!: string;
@OneToOne(() => User, (user) => user.id, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: true })
@JoinColumn({ name: 'user_id' })
public user: User;
}