mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 10:03:40 +01:00
Change db to use /data if it exists
This commit is contained in:
parent
3dd316c796
commit
16dd661d48
1 changed files with 4 additions and 2 deletions
|
@ -36,8 +36,10 @@ __all__ = [
|
||||||
T = TypeVar("T")
|
T = TypeVar("T")
|
||||||
T_co = TypeVar("T_co", covariant=True)
|
T_co = TypeVar("T_co", covariant=True)
|
||||||
|
|
||||||
|
_pth = "/main.db"
|
||||||
registry = orm.ModelRegistry(Database("sqlite:///main.db"))
|
if Path("/data").exists():
|
||||||
|
_pth = "/data/main.db"
|
||||||
|
registry = orm.ModelRegistry(Database("sqlite://" + _pth))
|
||||||
|
|
||||||
|
|
||||||
async def get_or_none(model: T, **kw) -> Optional[T_co]:
|
async def get_or_none(model: T, **kw) -> Optional[T_co]:
|
||||||
|
|
Loading…
Reference in a new issue