fossasia/open-event-orga-server

View on GitHub
migrations/versions/rev-2020-06-30-20:07:55-f177c14710f1_.py

Summary

Maintainability
C
1 day
Test Coverage
"""empty message

Revision ID: f177c14710f1
Revises: 64439b77fa6d
Create Date: 2020-06-30 20:07:55.320285

"""

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'f177c14710f1'
down_revision = '64439b77fa6d'


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute('DELETE FROM custom_forms WHERE deleted_at IS NOT NULL')
    op.execute('DELETE FROM event_sub_topics WHERE deleted_at IS NOT NULL')

    op.drop_column('custom_forms', 'deleted_at')
    op.drop_column('event_sub_topics', 'deleted_at')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('event_sub_topics', sa.Column('deleted_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True))
    op.add_column('custom_forms', sa.Column('deleted_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True))
    # ### end Alembic commands ###