🐛 fix(alembic): change "user_id" column in "flow" table to be nullable to handle existing data without a user_id
This commit is contained in:
parent
a290a68605
commit
fc32ee63e1
1 changed files with 1 additions and 1 deletions
|
|
@ -37,7 +37,7 @@ def upgrade() -> None:
|
||||||
op.drop_column("apikey", "create_at")
|
op.drop_column("apikey", "create_at")
|
||||||
with contextlib.suppress(sa.exc.OperationalError):
|
with contextlib.suppress(sa.exc.OperationalError):
|
||||||
op.add_column(
|
op.add_column(
|
||||||
"flow", sa.Column("user_id", sqlmodel.sql.sqltypes.GUID(), nullable=False)
|
"flow", sa.Column("user_id", sqlmodel.sql.sqltypes.GUID(), nullable=True)
|
||||||
)
|
)
|
||||||
op.create_index(op.f("ix_flow_user_id"), "flow", ["user_id"], unique=False)
|
op.create_index(op.f("ix_flow_user_id"), "flow", ["user_id"], unique=False)
|
||||||
op.create_foreign_key(None, "flow", "user", ["user_id"], ["id"])
|
op.create_foreign_key(None, "flow", "user", ["user_id"], ["id"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue