# pylint: disable=invalid-name
"""CvrBallot ballot_position and record_id

Revision ID: f44bbbb8b076
Revises: df1334fc5fe9
Create Date: 2021-04-06 17:08:30.714912+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "f44bbbb8b076"
down_revision = "df1334fc5fe9"
branch_labels = None
depends_on = None


def upgrade():
    op.add_column("cvr_ballot", sa.Column("record_id", sa.Integer()))
    op.execute("UPDATE cvr_ballot SET record_id = ballot_position")
    op.alter_column("cvr_ballot", "record_id", nullable=False)


def downgrade():  # pragma: no cover
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    # op.drop_column('cvr_ballot', 'record_id')
    # ### end Alembic commands ###
