Fix unique constraints for id column (#1583)
* Fix unique constraints for id column * Update version in pyproject.toml
This commit is contained in:
parent
b43e4de38f
commit
feb29ddbb9
3 changed files with 505 additions and 481 deletions
971
poetry.lock
generated
971
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,13 +1,12 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "langflow"
|
name = "langflow"
|
||||||
version = "0.6.11"
|
version = "0.6.12"
|
||||||
description = "A Python package with a built-in web application"
|
description = "A Python package with a built-in web application"
|
||||||
authors = ["Logspace <contact@logspace.ai>"]
|
authors = ["Logspace <contact@logspace.ai>"]
|
||||||
maintainers = [
|
maintainers = [
|
||||||
"Carlos Coelho <carlos@logspace.ai>",
|
"Carlos Coelho <carlos@logspace.ai>",
|
||||||
"Cristhian Zanforlin <cristhian.lousa@gmail.com>",
|
"Cristhian Zanforlin <cristhian.lousa@gmail.com>",
|
||||||
"Gabriel Almeida <gabriel@logspace.ai>",
|
"Gabriel Almeida <gabriel@logspace.ai>",
|
||||||
"Gustavo Schaedler <gustavopoa@gmail.com>",
|
|
||||||
"Igor Carvalho <igorr.ackerman@gmail.com>",
|
"Igor Carvalho <igorr.ackerman@gmail.com>",
|
||||||
"Lucas Eduoli <lucaseduoli@gmail.com>",
|
"Lucas Eduoli <lucaseduoli@gmail.com>",
|
||||||
"Otávio Anovazzi <otavio2204@gmail.com>",
|
"Otávio Anovazzi <otavio2204@gmail.com>",
|
||||||
|
|
|
||||||
|
|
@ -26,20 +26,14 @@ def upgrade() -> None:
|
||||||
flow_constraints = inspector.get_unique_constraints("flow")
|
flow_constraints = inspector.get_unique_constraints("flow")
|
||||||
user_constraints = inspector.get_unique_constraints("user")
|
user_constraints = inspector.get_unique_constraints("user")
|
||||||
try:
|
try:
|
||||||
if not any(
|
if not any(constraint['column_names'] == ['id'] for constraint in api_key_constraints):
|
||||||
constraint["name"] == "uq_apikey_id" for constraint in api_key_constraints
|
|
||||||
):
|
|
||||||
with op.batch_alter_table("apikey", schema=None) as batch_op:
|
with op.batch_alter_table("apikey", schema=None) as batch_op:
|
||||||
|
|
||||||
batch_op.create_unique_constraint("uq_apikey_id", ["id"])
|
batch_op.create_unique_constraint("uq_apikey_id", ["id"])
|
||||||
if not any(
|
if not any(constraint["column_names"] == ["id"] for constraint in flow_constraints):
|
||||||
constraint["name"] == "uq_flow_id" for constraint in flow_constraints
|
|
||||||
):
|
|
||||||
with op.batch_alter_table("flow", schema=None) as batch_op:
|
with op.batch_alter_table("flow", schema=None) as batch_op:
|
||||||
batch_op.create_unique_constraint("uq_flow_id", ["id"])
|
batch_op.create_unique_constraint("uq_flow_id", ["id"])
|
||||||
if not any(
|
if not any(constraint["column_names"] == ["id"] for constraint in user_constraints):
|
||||||
constraint["name"] == "uq_user_id" for constraint in user_constraints
|
|
||||||
):
|
|
||||||
with op.batch_alter_table("user", schema=None) as batch_op:
|
with op.batch_alter_table("user", schema=None) as batch_op:
|
||||||
batch_op.create_unique_constraint("uq_user_id", ["id"])
|
batch_op.create_unique_constraint("uq_user_id", ["id"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue