migration
This commit is contained in:
1 parent
a69b15a3e8
commit
557020a824
1 file changed
+36
@@ -0,0 +1,36 @@
|
|||||||
|
"""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 ###
|
||||||
Reference in new issue
Block a user