4823da1d26cf_add_tool_file.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. """add tool file
  2. Revision ID: 4823da1d26cf
  3. Revises: 053da0c1d756
  4. Create Date: 2024-01-15 11:37:16.782718
  5. """
  6. import sqlalchemy as sa
  7. from alembic import op
  8. from sqlalchemy.dialects import postgresql
  9. # revision identifiers, used by Alembic.
  10. revision = '4823da1d26cf'
  11. down_revision = '053da0c1d756'
  12. branch_labels = None
  13. depends_on = None
  14. def upgrade():
  15. # ### commands auto generated by Alembic - please adjust! ###
  16. op.create_table('tool_files',
  17. sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
  18. sa.Column('user_id', postgresql.UUID(), nullable=False),
  19. sa.Column('tenant_id', postgresql.UUID(), nullable=False),
  20. sa.Column('conversation_id', postgresql.UUID(), nullable=False),
  21. sa.Column('file_key', sa.String(length=255), nullable=False),
  22. sa.Column('mimetype', sa.String(length=255), nullable=False),
  23. sa.Column('original_url', sa.String(length=255), nullable=True),
  24. sa.PrimaryKeyConstraint('id', name='tool_file_pkey')
  25. )
  26. # ### end Alembic commands ###
  27. def downgrade():
  28. # ### commands auto generated by Alembic - please adjust! ###
  29. op.drop_table('tool_files')
  30. # ### end Alembic commands ###