mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 12:49:41 +03:00
Some changes in entities
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
||||
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { ProxyUser } from './proxy_user.entity';
|
||||
|
||||
@Entity()
|
||||
export class Payment {
|
||||
constructor(props?: Partial<Payment>) {
|
||||
Object.assign(this, props);
|
||||
}
|
||||
|
||||
@PrimaryGeneratedColumn('increment')
|
||||
public id!: number;
|
||||
|
||||
@Column()
|
||||
public uuidUser!: string;
|
||||
public user_uuid!: 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' })
|
||||
@ManyToOne(() => ProxyUser, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'user_uuid' })
|
||||
user: ProxyUser;
|
||||
|
||||
constructor(props?: Partial<Payment>) {
|
||||
Object.assign(this, props);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm';
|
||||
import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { Admin } from './admin.entity';
|
||||
@Entity()
|
||||
export class Post {
|
||||
@@ -14,10 +14,13 @@ export class Post {
|
||||
|
||||
@Column({ nullable: false })
|
||||
from_user_id: string;
|
||||
|
||||
@Column()
|
||||
text: string;
|
||||
|
||||
@Column()
|
||||
media_group_id: string;
|
||||
|
||||
@Column({ type: 'timestamptz' })
|
||||
timestamps: Date;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user