7bdef072e63a_add_workflow_tool.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. """add workflow tool
  2. Revision ID: 7bdef072e63a
  3. Revises: 5fda94355fce
  4. Create Date: 2024-05-04 09:47:19.366961
  5. """
  6. import sqlalchemy as sa
  7. from alembic import op
  8. import models.types
  9. # revision identifiers, used by Alembic.
  10. revision = '7bdef072e63a'
  11. down_revision = '5fda94355fce'
  12. branch_labels = None
  13. depends_on = None
  14. def upgrade():
  15. # ### commands auto generated by Alembic - please adjust! ###
  16. op.create_table('tool_workflow_providers',
  17. sa.Column('id', models.types.StringUUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
  18. sa.Column('name', sa.String(length=40), nullable=False),
  19. sa.Column('icon', sa.String(length=255), nullable=False),
  20. sa.Column('app_id', models.types.StringUUID(), nullable=False),
  21. sa.Column('user_id', models.types.StringUUID(), nullable=False),
  22. sa.Column('tenant_id', models.types.StringUUID(), nullable=False),
  23. sa.Column('description', sa.Text(), nullable=False),
  24. sa.Column('parameter_configuration', sa.Text(), server_default='[]', nullable=False),
  25. sa.Column('created_at', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP(0)'), nullable=False),
  26. sa.Column('updated_at', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP(0)'), nullable=False),
  27. sa.PrimaryKeyConstraint('id', name='tool_workflow_provider_pkey'),
  28. sa.UniqueConstraint('name', 'tenant_id', name='unique_workflow_tool_provider'),
  29. sa.UniqueConstraint('tenant_id', 'app_id', name='unique_workflow_tool_provider_app_id')
  30. )
  31. # ### end Alembic commands ###
  32. def downgrade():
  33. op.drop_table('tool_workflow_providers')
  34. # ### end Alembic commands ###