From ed107f2d5c25a87084eed0b1dd84852e79b7923a Mon Sep 17 00:00:00 2001 From: SelfhostedPro Date: Fri, 25 Sep 2020 06:55:14 -0700 Subject: [PATCH] added check for alembiic versions folder --- .gitignore | 3 +-- root/etc/cont-init.d/31-migrate | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0cb15c03..d54462fa 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ venv *.db node_modules config -*.pyc -versions \ No newline at end of file +*.pyc \ No newline at end of file diff --git a/root/etc/cont-init.d/31-migrate b/root/etc/cont-init.d/31-migrate index e835a20b..8d892cc6 100644 --- a/root/etc/cont-init.d/31-migrate +++ b/root/etc/cont-init.d/31-migrate @@ -3,6 +3,10 @@ cd / #Stage a db migration # s6-setuidgid abc \ # sqlite3 /config/data.sqlite "DROP TABLE IF EXISTS alembic_version;" +# Make sure versions folder exists +s6-setuidgid abc \ + mkdir -p /alembic/versions +# Prepare db migration s6-setuidgid abc \ alembic revision --autogenerate -m "automated db upgrade" #Execute db migration