From 6cbbc364104707460aa7e0c27b06bfb85c0866cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20J=C3=B6nsson?= Date: Sat, 15 Nov 2025 21:10:36 +0100 Subject: [PATCH] renamed db from users.db to database.db --- README.md | 12 +++++++++++- app.py | 2 +- docker-compose.yml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 558f5e7..2cef2ba 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,17 @@ Note: Docker will automatically load the `.env` file from your project root The application will be available at `http://localhost:5001` ### Persisting Data -The database will be preserved between container restarts through the `./instance` volume mount. +The database file (database.db) will be preserved between container restarts through the `./instance` volume mount. + +**Important:** After renaming the database: +1. Delete the old database file if it exists: +```bash +rm instance/users.db +``` +2. Reinitialize the database: +```bash +flask init-db +``` ## Configuration diff --git a/app.py b/app.py index 27f184d..4a8d101 100644 --- a/app.py +++ b/app.py @@ -9,7 +9,7 @@ app.config["SECRET_KEY"] = os.environ.get( "FLASK_SECRET_KEY", "your-secret-key-here" # Fallback for development only ) app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + os.path.join( - os.path.abspath(os.path.dirname(__file__)), "instance/users.db" + os.path.abspath(os.path.dirname(__file__)), "instance/database.db" ) app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False diff --git a/docker-compose.yml b/docker-compose.yml index a28611e..da92fd8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,6 @@ services: environment: - FLASK_ENV=production - FLASK_SECRET_KEY=${FLASK_SECRET_KEY} # Required - set in .env file - - SQLALCHEMY_DATABASE_URI=sqlite:////app/instance/users.db + - SQLALCHEMY_DATABASE_URI=sqlite:////app/instance/database.db volumes: - ./instance:/app/instance