"""add users table

Revision ID: 0ee140bf938a
Revises: 5a935c07953e
Create Date: 2019-07-05 22:19:52.083158

"""
from alembic import op
import sqlalchemy as sa

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('sub', sa.CHAR(length=21), nullable=False),
                    sa.Column('picture', sa.String(length=200), nullable=True),
                    sa.Column('given_name', sa.String(length=50), nullable=False),
                    sa.Column('family_name', sa.String(length=50), nullable=False),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_users_sub'), 'users', ['sub'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_users_sub'), table_name='users')
    op.drop_table('users')
    # ### end Alembic commands ###
