"""Rename submission_window table to banner

Revision ID: 7b70f7defa50
Revises: 6f9353ce5ae9
Create Date: 2020-08-20 12:14:46.382634

"""

# revision identifiers, used by Alembic.
revision = '7b70f7defa50'
down_revision = '6f9353ce5ae9'
branch_labels = None
depends_on = None

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

def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.rename_table('submission_window', 'banner')
    op.alter_column('banner', 'window_id', new_column_name='banner_id')
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('banner', 'banner_id', new_column_name='window_id')
    op.rename_table('banner', 'submission_window')
    # ### end Alembic commands ###

