"""Locales

Revision ID: dbbc49e3ac86
Revises: 5f97163991e5
Create Date: 2019-07-12 01:38:09.422222

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "dbbc49e3ac86"
down_revision = "5f97163991e5"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "poll",
        sa.Column("locale", sa.String(), server_default="english", nullable=True),
    )
    op.add_column(
        "user",
        sa.Column("locale", sa.String(), server_default="english", nullable=True),
    )
    op.add_column(
        "user",
        sa.Column(
            "updated_at", sa.DateTime(), server_default=sa.text("now()"), nullable=False
        ),
    )
    op.drop_column("user", "admin")
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "user", sa.Column("admin", sa.BOOLEAN(), autoincrement=False, nullable=False)
    )
    op.drop_column("user", "updated_at")
    op.drop_column("user", "locale")
    op.drop_column("poll", "locale")
    # ### end Alembic commands ###
