"""Update user model

Revision ID: 0f49baa10680
Revises: 5ea2ffe20bef
Create Date: 2021-03-03 12:09:48.724409

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '0f49baa10680'
down_revision = '5ea2ffe20bef'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('created_at', sa.DateTime(), nullable=True))
    op.add_column('users', sa.Column('karma', sa.Integer(), nullable=False))
    op.add_column('users', sa.Column('nonprofit', sa.Boolean(), nullable=False))
    op.add_column('users', sa.Column('score', sa.Integer(), nullable=False))
    op.add_column('users', sa.Column('updated_at', sa.DateTime(), nullable=True))
    op.add_column('users', sa.Column('zip_code', sa.String(length=40), nullable=False))
    op.drop_constraint('users_username_key', 'users', type_='unique')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint('users_username_key', 'users', ['username'])
    op.drop_column('users', 'zip_code')
    op.drop_column('users', 'updated_at')
    op.drop_column('users', 'score')
    op.drop_column('users', 'nonprofit')
    op.drop_column('users', 'karma')
    op.drop_column('users', 'created_at')
    # ### end Alembic commands ###
