This commit adds the Payment and ProxyUser entities to the database.

This commit is contained in:
Errormacr
2023-11-24 17:14:11 +03:00
parent c76c61c23c
commit f42741a481
4 changed files with 57 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
import { ProxyUser } from './ProxyUser.entity';
@Entity()
export class Payment {
@PrimaryGeneratedColumn('uuid')
public id!: string;
@Column()
public uuidUser!: string;
@Column({ type: 'timestamptz' })
public payTime!: Date;
@ManyToOne(() => ProxyUser, { onDelete: 'CASCADE' }) // Assuming you want to cascade delete when a user is deleted
@JoinColumn({ name: 'uuidUser' })
user: ProxyUser;
constructor(props?: Partial<Payment>) {
Object.assign(this, props);
}
}