BUG: reset_database.py does not delete the actual application database
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
What happened?
The database reset script backend/reset_database.py attempts to find and delete database files using glob.glob("app/database/*.db"):
def delete_db_files():
db_files = glob.glob("app/database/*.db")
for db_file in db_files:
# ... deletes file
However, the actual application database is stored in the system's local user data directory as defined in backend/app/config/settings.py:
DATABASE_PATH = os.path.join(user_data_dir("PictoPy"), "database", "PictoPy.db")
Because the script looks in the wrong folder (backend/app/database/*.db contains only python files), it never finds the real database file and is completely non-functional when run.
Proposed Fix: Import DATABASE_PATH from app.config.settings inside reset_database.py and delete that file/path.
I wish to work on this issue !
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
@rohan-pandeyy Can you check the need of this issue & assign me ??