Add logger import and fix error handling during upgrade in alembic scripts (#1650)

* Add logger import in script.py.mako

* Fix error handling during upgrade in alembic scripts

* Bump version to 0.6.14 in pyproject.toml
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-04-09 11:08:26 -03:00 committed by Gabriel Luiz Freitas Almeida
commit 537cf93493
2 changed files with 7 additions and 6 deletions

8
poetry.lock generated
View file

@ -3898,13 +3898,13 @@ files = [
[[package]]
name = "joblib"
version = "1.3.2"
version = "1.4.0"
description = "Lightweight pipelining with Python functions"
optional = false
python-versions = ">=3.7"
python-versions = ">=3.8"
files = [
{file = "joblib-1.3.2-py3-none-any.whl", hash = "sha256:ef4331c65f239985f3f2220ecc87db222f08fd22097a3dd5698f693875f8cbb9"},
{file = "joblib-1.3.2.tar.gz", hash = "sha256:92f865e621e17784e7955080b6d042489e3b8e294949cc44c6eac304f59772b1"},
{file = "joblib-1.4.0-py3-none-any.whl", hash = "sha256:42942470d4062537be4d54c83511186da1fc14ba354961a2114da91efa9a4ed7"},
{file = "joblib-1.4.0.tar.gz", hash = "sha256:1eb0dc091919cd384490de890cb5dfd538410a6d4b3b54eef09fb8c50b409b1c"},
]
[[package]]

View file

@ -11,6 +11,7 @@ from typing import Sequence, Union
import sqlalchemy as sa
import sqlmodel
from alembic import op
from loguru import logger # noqa
from sqlalchemy.engine.reflection import Inspector
# revision identifiers, used by Alembic.
@ -46,9 +47,9 @@ def upgrade() -> None:
if "fk_flow_user_id_user" not in indices_names:
batch_op.create_foreign_key("fk_flow_user_id_user", "user", ["user_id"], ["id"])
except Exception:
except Exception as e:
logger.exception(f"Error during upgrade: {e}")
pass
# ### end Alembic commands ###
def downgrade() -> None: