Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

softDelete updates deleted rows #9344

Open
duniyalr opened this issue Sep 3, 2022 · 0 comments
Open

softDelete updates deleted rows #9344

duniyalr opened this issue Sep 3, 2022 · 0 comments

Comments

@duniyalr
Copy link

duniyalr commented Sep 3, 2022

Hi!

Issue Description

i am using softDelete and QueryBuilder and i just found out that there is no check for deletedAt column (with @DeleteDateColumn() decorator) to be NULL. so every time you run the query the rows will updated even if they were softDeleted before.

I don't know this is a feature or bug!

my db is mysql.

and my code:

this.dataSource.getRepository(Project)
      .createQueryBuilder("projects")
      .where("projects.id = :id", {id: projectId})
      .andWhere("projects.deletedAt IS NULL") // i just add this to filter deleted rows
      .softDelete()
      .execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant