mirror of https://github.com/langgenius/dify.git
feat: Add "type" field to PipelineRecommendedPlugin model; (#29724)
This commit is contained in:
commit
5d40064f12
|
|
@ -0,0 +1,33 @@
|
|||
"""add type column not null default tool
|
||||
|
||||
Revision ID: 2536f83803a8
|
||||
Revises: 6bb0832495f0
|
||||
Create Date: 2025-12-16 14:24:40.740253
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import models as models
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2536f83803a8'
|
||||
down_revision = '6bb0832495f0'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('pipeline_recommended_plugins', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('type', sa.String(length=50), nullable=False, server_default='tool'))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('pipeline_recommended_plugins', schema=None) as batch_op:
|
||||
batch_op.drop_column('type')
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
|
@ -1532,7 +1532,7 @@ class PipelineRecommendedPlugin(TypeBase):
|
|||
)
|
||||
plugin_id: Mapped[str] = mapped_column(LongText, nullable=False)
|
||||
provider_name: Mapped[str] = mapped_column(LongText, nullable=False)
|
||||
type: Mapped[str] = mapped_column(sa.String(50), nullable=True)
|
||||
type: Mapped[str] = mapped_column(sa.String(50), nullable=False, default="tool")
|
||||
position: Mapped[int] = mapped_column(sa.Integer, nullable=False, default=0)
|
||||
active: Mapped[bool] = mapped_column(sa.Boolean, nullable=False, default=True)
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
|
|
|
|||
Loading…
Reference in New Issue