mirror of https://github.com/langgenius/dify.git
ECO-171: update unique constraints
This commit is contained in:
parent
5fd83e9425
commit
5b93ed3fcd
|
|
@ -58,16 +58,9 @@ def upgrade():
|
|||
sa.UniqueConstraint(
|
||||
"end_user_id",
|
||||
"provider",
|
||||
"name",
|
||||
name="unique_enduser_authentication_provider",
|
||||
),
|
||||
)
|
||||
op.create_index(
|
||||
"tool_enduser_authentication_provider_name_idx",
|
||||
"tool_enduser_authentication_providers",
|
||||
["name"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"tool_enduser_authentication_provider_end_user_id_idx",
|
||||
"tool_enduser_authentication_providers",
|
||||
|
|
@ -93,10 +86,6 @@ def downgrade():
|
|||
"tool_enduser_authentication_provider_end_user_id_idx",
|
||||
table_name="tool_enduser_authentication_providers",
|
||||
)
|
||||
op.drop_index(
|
||||
"tool_enduser_authentication_provider_name_idx",
|
||||
table_name="tool_enduser_authentication_providers",
|
||||
)
|
||||
op.drop_table("tool_enduser_authentication_providers")
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class EndUserAuthenticationProvider(TypeBase):
|
|||
|
||||
__tablename__ = "tool_enduser_authentication_providers"
|
||||
__table_args__ = (
|
||||
sa.UniqueConstraint("end_user_id", "provider", "name"),
|
||||
sa.UniqueConstraint("end_user_id", "provider"),
|
||||
)
|
||||
|
||||
# id of the authentication provider
|
||||
|
|
@ -128,7 +128,6 @@ class EndUserAuthenticationProvider(TypeBase):
|
|||
String(256),
|
||||
nullable=False,
|
||||
default="API KEY 1",
|
||||
index=True
|
||||
)
|
||||
# id of the tenant
|
||||
tenant_id: Mapped[str] = mapped_column(StringUUID, nullable=False)
|
||||
|
|
|
|||
Loading…
Reference in New Issue