mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 12:49:41 +03:00
Merge branch 'entitysEndpoints' of https://github.com/MrSedan/neuro-reply-website into entitysEndpoints
This commit is contained in:
31
backend/libs/database/proxy_user.entity.ts
Normal file
31
backend/libs/database/proxy_user.entity.ts
Normal 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;
|
||||
}
|
||||
31
backend/libs/database/proxy_user_table.entity.ts
Normal file
31
backend/libs/database/proxy_user_table.entity.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user