diff --git a/db/alembic/env.py b/db/alembic/env.py index 8ec56b5..d20989f 100644 --- a/db/alembic/env.py +++ b/db/alembic/env.py @@ -6,13 +6,12 @@ from sqlalchemy.engine import Connection from sqlalchemy.ext.asyncio import async_engine_from_config -from utils.config import SQLALCHEMY_DATABASE_URL from db.base import Base # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config -config.set_main_option("sqlalchemy.url", SQLALCHEMY_DATABASE_URL) +config.set_main_option("sqlalchemy.url", "sqlite+aiosqlite:///data/db.sqlite3") # Interpret the config file for Python logging. # This line sets up loggers basically. if config.config_file_name is not None: diff --git a/db/base.py b/db/base.py index 4efa7ff..0d1cc21 100644 --- a/db/base.py +++ b/db/base.py @@ -4,12 +4,10 @@ from sqlalchemy.ext.asyncio import AsyncAttrs, AsyncSession, create_async_engine from sqlalchemy.orm import DeclarativeBase, sessionmaker -from utils import config - # Create an asynchronous engine engine = create_async_engine( - config.SQLALCHEMY_DATABASE_URL, + "sqlite+aiosqlite:///data/db.sqlite3", connect_args={"check_same_thread": False}, echo=False, ) diff --git a/utils/config.py b/utils/config.py index bc3e91b..8ba7eb1 100644 --- a/utils/config.py +++ b/utils/config.py @@ -22,10 +22,6 @@ def require_setting(setting_name, value): ) # required require_setting("TELEGRAM_ADMINS_ID", TELEGRAM_ADMINS_ID) -SQLALCHEMY_DATABASE_URL = config( - "SQLALCHEMY_DATABASE_URL", default="sqlite+aiosqlite:///data/db.sqlite3", cast=str -) - # Marzban Panel Settings MARZBAN_USERNAME = config("MARZBAN_USERNAME", default="", cast=str) # required require_setting("MARZBAN_USERNAME", MARZBAN_USERNAME)