mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 14:15:52 +08:00
Merge branch 'feat/mcp' into deploy/dev
This commit is contained in:
commit
a4dfb548c3
@ -0,0 +1,39 @@
|
|||||||
|
"""mcp tool server url change type
|
||||||
|
|
||||||
|
Revision ID: 162a22ab34cf
|
||||||
|
Revises: de71f8771550
|
||||||
|
Create Date: 2025-05-30 10:54:44.511650
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import models as models
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '162a22ab34cf'
|
||||||
|
down_revision = 'de71f8771550'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('tool_mcp_providers', schema=None) as batch_op:
|
||||||
|
batch_op.drop_constraint(batch_op.f('unique_mcp_tool_provider'), type_='unique')
|
||||||
|
batch_op.drop_constraint(batch_op.f('unique_mcp_tool_provider_server_url_hash'), type_='unique')
|
||||||
|
batch_op.create_unique_constraint('unique_mcp_provider_name', ['tenant_id', 'name'])
|
||||||
|
batch_op.create_unique_constraint('unique_mcp_provider_server_url', ['tenant_id', 'server_url_hash'])
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('tool_mcp_providers', schema=None) as batch_op:
|
||||||
|
batch_op.drop_constraint('unique_mcp_provider_server_url', type_='unique')
|
||||||
|
batch_op.drop_constraint('unique_mcp_provider_name', type_='unique')
|
||||||
|
batch_op.create_unique_constraint(batch_op.f('unique_mcp_tool_provider_server_url_hash'), ['server_url_hash'])
|
||||||
|
batch_op.create_unique_constraint(batch_op.f('unique_mcp_tool_provider'), ['name', 'tenant_id'])
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
@ -232,8 +232,8 @@ class MCPToolProvider(Base):
|
|||||||
__tablename__ = "tool_mcp_providers"
|
__tablename__ = "tool_mcp_providers"
|
||||||
__table_args__ = (
|
__table_args__ = (
|
||||||
db.PrimaryKeyConstraint("id", name="tool_mcp_provider_pkey"),
|
db.PrimaryKeyConstraint("id", name="tool_mcp_provider_pkey"),
|
||||||
db.UniqueConstraint("name", "tenant_id", name="unique_mcp_tool_provider"),
|
db.UniqueConstraint("tenant_id", "server_url_hash", name="unique_mcp_provider_server_url"),
|
||||||
db.UniqueConstraint("server_url_hash", name="unique_mcp_tool_provider_server_url_hash"),
|
db.UniqueConstraint("tenant_id", "name", name="unique_mcp_provider_name"),
|
||||||
)
|
)
|
||||||
|
|
||||||
id: Mapped[str] = mapped_column(StringUUID, server_default=db.text("uuid_generate_v4()"))
|
id: Mapped[str] = mapped_column(StringUUID, server_default=db.text("uuid_generate_v4()"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user