c0fbf31ca0db_update_file_table.py 932 B

1234567891011121314151617181920212223242526272829303132
  1. """Update file table
  2. Revision ID: c0fbf31ca0db
  3. Revises: ca81bd47c050
  4. Create Date: 2024-09-20 15:26:35.241684
  5. """
  6. from typing import Sequence, Union
  7. import sqlalchemy as sa
  8. from alembic import op
  9. # revision identifiers, used by Alembic.
  10. revision: str = "c0fbf31ca0db"
  11. down_revision: Union[str, None] = "ca81bd47c050"
  12. branch_labels: Union[str, Sequence[str], None] = None
  13. depends_on: Union[str, Sequence[str], None] = None
  14. def upgrade():
  15. # ### commands auto generated by Alembic - please adjust! ###
  16. op.add_column("file", sa.Column("hash", sa.String(), nullable=True))
  17. op.add_column("file", sa.Column("data", sa.JSON(), nullable=True))
  18. op.add_column("file", sa.Column("updated_at", sa.BigInteger(), nullable=True))
  19. def downgrade():
  20. # ### commands auto generated by Alembic - please adjust! ###
  21. op.drop_column("file", "updated_at")
  22. op.drop_column("file", "data")
  23. op.drop_column("file", "hash")