<reponame>j-jzk/donors_registry<gh_stars>1-10
"""Minimum donation count for each medal

Revision ID: 9c632e7c77df
Revises: <PASSWORD>
Create Date: 2021-01-16 11:54:59.767379

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "9c632e7c77df"
down_revision = "<PASSWORD>"
branch_labels = None
depends_on = None


def upgrade():
    op.add_column("medals", sa.Column("minimum_donations", sa.Integer(), nullable=True))
    op.execute("UPDATE medals SET minimum_donations = 10  WHERE slug = 'br';")
    op.execute("UPDATE medals SET minimum_donations = 20  WHERE slug = 'st';")
    op.execute("UPDATE medals SET minimum_donations = 40  WHERE slug = 'zl';")
    op.execute("UPDATE medals SET minimum_donations = 80  WHERE slug = 'kr3';")
    op.execute("UPDATE medals SET minimum_donations = 120 WHERE slug = 'kr2';")
    op.execute("UPDATE medals SET minimum_donations = 160 WHERE slug = 'kr1';")
    op.execute("UPDATE medals SET minimum_donations = 250 WHERE slug = 'plk';")


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("medals", "minimum_donations")
    # ### end Alembic commands ###

"""Minimum donation count for each medal

Revision ID: 9c632e7c77df
Revises: <PASSWORD>
Create Date: 2021-01-16 11:54:59.767379

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "9c632e7c77df"
down_revision = "<PASSWORD>"
branch_labels = None
depends_on = None


def upgrade():
    op.add_column("medals", sa.Column("minimum_donations", sa.Integer(), nullable=True))
    op.execute("UPDATE medals SET minimum_donations = 10  WHERE slug = 'br';")
    op.execute("UPDATE medals SET minimum_donations = 20  WHERE slug = 'st';")
    op.execute("UPDATE medals SET minimum_donations = 40  WHERE slug = 'zl';")
    op.execute("UPDATE medals SET minimum_donations = 80  WHERE slug = 'kr3';")
    op.execute("UPDATE medals SET minimum_donations = 120 WHERE slug = 'kr2';")
    op.execute("UPDATE medals SET minimum_donations = 160 WHERE slug = 'kr1';")
    op.execute("UPDATE medals SET minimum_donations = 250 WHERE slug = 'plk';")


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("medals", "minimum_donations")
    # ### end Alembic commands ###
Minimum donation count for each medal  Revision ID: 9c632e7c77df Revises: <PASSWORD> Create Date: 2021-01-16 11:54:59.767379 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###