From db28067794018efe9ee4d65826d942c39ef74aba Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 18 2019 12:13:32 +0000 Subject: Add an alembic migration script for the voted_badge field in elections Signed-off-by: Pierre-Yves Chibon --- diff --git a/alembic/versions/5ecdd55b4af4_add_badge_support_to_elections.py b/alembic/versions/5ecdd55b4af4_add_badge_support_to_elections.py new file mode 100644 index 0000000..716bd54 --- /dev/null +++ b/alembic/versions/5ecdd55b4af4_add_badge_support_to_elections.py @@ -0,0 +1,27 @@ +"""Add badge support to elections + +Revision ID: 5ecdd55b4af4 +Revises: 2b8f5a6f10a4 +Create Date: 2019-03-18 12:21:59.536380 + +""" + +# revision identifiers, used by Alembic. +revision = '5ecdd55b4af4' +down_revision = '2b8f5a6f10a4' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + """ Add the voted_badge column to the Elections table. """ + op.add_column( + 'elections', + sa.Column('voted_badge', sa.Unicde(250), nullable=True) + ) + + +def downgrade(): + """ Drop the voted_badge column from the Elections table. """ + op.drop_column('elections', 'voted_badge')