update user cascade

This commit is contained in:
2025-01-15 15:34:52 +07:00
parent d25b073ff0
commit e576df89c8
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ export class UserActivity {
@JoinColumn({ name: 'application' })
application: Application
@ManyToOne(() => User, (user) => user.id, { nullable: true })
@ManyToOne(() => User, (user) => user.id, { nullable: true, onDelete: 'CASCADE' })
@JoinColumn({ name: 'id_user' })
user: User;

View File

@ -37,7 +37,7 @@ export class User {
})
name: string;
@ManyToMany(() => UserRole, { onDelete: 'CASCADE' })
@ManyToMany(() => UserRole, { onDelete: 'RESTRICT' })
@JoinTable()
roles: UserRole[]