"""firstlast_name_addedto_user

Revision ID: 2995eea7b27d
Revises: cc384b0d1357
Create Date: 2019-10-23 15:54:57.267225

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '2995eea7b27d'
down_revision = 'cc384b0d1357'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user', sa.Column('first_name', sa.String(), nullable=False))
    op.add_column('user', sa.Column('last_name', sa.String(), nullable=False))
    op.alter_column('user', 'created_by',
               existing_type=sa.VARCHAR(),
               nullable=False)
    op.alter_column('user', 'created_on',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    op.alter_column('user', 'public_id',
               existing_type=sa.VARCHAR(length=128),
               nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('user', 'public_id',
               existing_type=sa.VARCHAR(length=128),
               nullable=True)
    op.alter_column('user', 'created_on',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('user', 'created_by',
               existing_type=sa.VARCHAR(),
               nullable=True)
    op.drop_column('user', 'last_name')
    op.drop_column('user', 'first_name')
    # ### end Alembic commands ###
