"""Fix default for locale

Revision ID: 215dc3cce5c3
Revises: 294c1896fc24
Create Date: 2019-08-19 15:57:14.724883

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "215dc3cce5c3"
down_revision = "294c1896fc24"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "poll",
        "locale",
        existing_type=sa.VARCHAR(),
        server_default=None,
        existing_nullable=True,
    )
    op.alter_column(
        "user",
        "locale",
        existing_type=sa.VARCHAR(),
        server_default=None,
        existing_nullable=True,
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "user",
        "locale",
        existing_type=sa.VARCHAR(),
        server_default=sa.text("'english'::character varying"),
        existing_nullable=True,
    )
    op.alter_column(
        "poll",
        "locale",
        existing_type=sa.VARCHAR(),
        server_default=sa.text("'english'::character varying"),
        existing_nullable=True,
    )
    # ### end Alembic commands ###
