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

Deleting completed tasks from DB (#369) #370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Aga-C
Copy link
Member

@Aga-C Aga-C commented Nov 11, 2024

What is it?

  • Bugfix
  • Feature
  • Codebase improvement

Description of the changes in your PR

  • Added foreign key to tasks table with ON DELETE CASCADE to ensure that removing event will always remove an entry in the tasks table.
    • SQLite doesn't support ALTER TABLE ADD CONSTRAINT, so I had to do a small workaround in the migration.
    • I don't know if I should commit schema JSON. If it's not needed, I can remove it.
  • Existing completed tasks without entry in events are deleted during migration.
  • Also added code for removing task occurrences to fully support recurring tasks.

Fixes the following issue(s)

Acknowledgement

@nofishonfriday
Copy link
Contributor

nofishonfriday commented Nov 13, 2024

@Aga-C As the reporter of this issue I wanted to say thanks for fixing it.
I use the Fossify apps on a phone with very limited storage space (S4 mini), that's why I care they behave properly.
I planned to look into this issue myself (currently learning Android dev) but you were so fast, but now I can study your code instead which is also good. :)

Anyway, regarding

I don't know if I should commit schema JSON. If it's not needed, I can remove it.

I recently did a PR for another FOSS app where I had the same question and found this:
https://stackoverflow.com/questions/44322178/room-schema-export-directory-is-not-provided-to-the-annotation-processor-so-we/44645943#44645943

so I commited the JSON file and it was merged.
But @naveensingh will decide finally anway. :)
Have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data accumulation when deleting a completed task
2 participants