"""empty message

Revision ID: 1f3623ade1e4
Revises: 4b97c55d96ac
Create Date: 2019-03-23 15:23:40.957540

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '1f3623ade1e4'
down_revision = '4b97c55d96ac'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute('''ALTER TABLE people ADD COLUMN name VARCHAR;''')
    op.execute('''UPDATE people SET
        name = CASE
                WHEN telegram_login = '273204308' THEN 'perminovs'
                WHEN telegram_login = '278135592' THEN 'abryazgin'
                WHEN telegram_login = '339423039' THEN 'zefirior' 
            END''')
    op.execute('''ALTER TABLE people ALTER COLUMN name SET NOT NULL;;''')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('people', 'name')
    # ### end Alembic commands ###
