added mealie
This commit is contained in:
parent
88ce2e6a5f
commit
8d47f6b09c
11 changed files with 295 additions and 8 deletions
25
mealie/mealie_init_db.patch
Normal file
25
mealie/mealie_init_db.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
diff --git a/mealie/db/init_db.py b/mealie/db/init_db.py
|
||||
index 90dd91a8..d19a5eac 100644
|
||||
--- a/mealie/db/init_db.py
|
||||
+++ b/mealie/db/init_db.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+import os
|
||||
from collections.abc import Callable
|
||||
from pathlib import Path
|
||||
from time import sleep
|
||||
@@ -85,7 +86,14 @@ def main():
|
||||
if max_retry == 0:
|
||||
raise ConnectionError("Database connection failed - exiting application.")
|
||||
|
||||
- alembic_cfg = Config(str(PROJECT_DIR / "alembic.ini"))
|
||||
+ alembic_cfg_path = os.getenv("ALEMBIC_CONFIG_FPATH")
|
||||
+ if not alembic_cfg_path:
|
||||
+ alembic_cfg_path = str(PROJECT_DIR / "alembic.ini")
|
||||
+
|
||||
+ if not os.path.isfile(alembic_cfg_path):
|
||||
+ raise Exception("Provided alembic config path doesn't exist")
|
||||
+
|
||||
+ alembic_cfg = Config(alembic_cfg_path)
|
||||
if db_is_at_head(alembic_cfg):
|
||||
logger.debug("Migration not needed.")
|
||||
else:
|
Loading…
Add table
Add a link
Reference in a new issue