mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
45 lines
1.7 KiB
Python
45 lines
1.7 KiB
Python
|
"""add tool providers
|
||
|
|
||
|
Revision ID: 7ce5a52e4eee
|
||
|
Revises: 2beac44e5f5f
|
||
|
Create Date: 2023-07-10 10:26:50.074515
|
||
|
|
||
|
"""
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
from sqlalchemy.dialects import postgresql
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = '7ce5a52e4eee'
|
||
|
down_revision = '2beac44e5f5f'
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.create_table('tool_providers',
|
||
|
sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
|
||
|
sa.Column('tenant_id', postgresql.UUID(), nullable=False),
|
||
|
sa.Column('tool_name', sa.String(length=40), nullable=False),
|
||
|
sa.Column('encrypted_credentials', sa.Text(), nullable=True),
|
||
|
sa.Column('is_enabled', sa.Boolean(), server_default=sa.text('false'), nullable=False),
|
||
|
sa.Column('created_at', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP(0)'), nullable=False),
|
||
|
sa.Column('updated_at', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP(0)'), nullable=False),
|
||
|
sa.PrimaryKeyConstraint('id', name='tool_provider_pkey'),
|
||
|
sa.UniqueConstraint('tenant_id', 'tool_name', name='unique_tool_provider_tool_name')
|
||
|
)
|
||
|
with op.batch_alter_table('app_model_configs', schema=None) as batch_op:
|
||
|
batch_op.add_column(sa.Column('sensitive_word_avoidance', sa.Text(), nullable=True))
|
||
|
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
with op.batch_alter_table('app_model_configs', schema=None) as batch_op:
|
||
|
batch_op.drop_column('sensitive_word_avoidance')
|
||
|
|
||
|
op.drop_table('tool_providers')
|
||
|
# ### end Alembic commands ###
|