update: the cascade option for user raltaions to other entities

This commit is contained in:
mahyargdz
2025-04-29 22:43:45 +03:30
parent d3b6cdfbf7
commit c46cad7ecc
7 changed files with 12 additions and 12 deletions
@@ -14,7 +14,7 @@ export class Invoice extends BaseEntity {
@Column({ type: "int", generated: "identity", insert: false })
numericId: number;
@ManyToOne(() => User, (user) => user.invoices, { nullable: true, onDelete: "RESTRICT" })
@ManyToOne(() => User, (user) => user.invoices, { nullable: true, onDelete: "SET NULL" })
user: User;
@Column({ type: "decimal", precision: 16, scale: 2, nullable: false, transformer: new DecimalTransformer() })