Files
memestream/migrations/versions/9159293e4f30_allow_vision_to_be_nullable.py
T
2024-04-08 17:01:53 +10:00

37 lines
1.2 KiB
Python

"""allow vision to be nullable
Revision ID: 9159293e4f30
Revises: e04bee35feab
Create Date: 2024-04-08 10:50:21.447942
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision: str = '9159293e4f30'
down_revision: Union[str, None] = 'e04bee35feab'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('attachments', 'vision',
existing_type=postgresql.JSON(astext_type=sa.Text()),
nullable=True)
op.drop_column('attachments', 'attributes')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('attachments', sa.Column('attributes', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=False))
op.alter_column('attachments', 'vision',
existing_type=postgresql.JSON(astext_type=sa.Text()),
nullable=False)
# ### end Alembic commands ###