microblog.pub/alembic/versions/79b5bcc918ce_tweak_inbox_objects_metadata.py

35 lines
1.1 KiB
Python
Raw Normal View History

2022-07-07 18:37:16 +00:00
"""Tweak inbox objects metadata
Revision ID: 79b5bcc918ce
Revises: 93e36ff5c691
Create Date: 2022-07-07 18:03:46.945044
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '79b5bcc918ce'
down_revision = '93e36ff5c691'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('inbox', sa.Column('is_deleted', sa.Boolean(), nullable=False, server_default="0"))
op.add_column('inbox', sa.Column('replies_count', sa.Integer(), nullable=False, server_default="0"))
op.drop_column('inbox', 'has_replies')
op.create_index(op.f('ix_outgoing_activity_id'), 'outgoing_activity', ['id'], unique=False)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_outgoing_activity_id'), table_name='outgoing_activity')
op.add_column('inbox', sa.Column('has_replies', sa.BOOLEAN(), nullable=False))
op.drop_column('inbox', 'replies_count')
op.drop_column('inbox', 'is_deleted')
# ### end Alembic commands ###