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:
parent
abbc0097e7
commit
537cf93493
2 changed files with 7 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue