"""Jsonplaceholder model

Revision ID: 2230b200350a
Revises: a17888e31e67
Create Date: 2021-03-04 18:34:33.166237

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2230b200350a'
down_revision = 'a17888e31e67'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('company',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=32), nullable=True),
    sa.Column('catchPhrase', sa.String(length=128), nullable=True),
    sa.Column('bs', sa.String(length=128), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('address',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('street', sa.String(length=32), nullable=True),
    sa.Column('suite', sa.String(length=32), nullable=True),
    sa.Column('city', sa.String(length=32), nullable=True),
    sa.Column('zipcode', sa.String(length=32), nullable=True),
    sa.Column('geo_lat', sa.String(length=32), nullable=True),
    sa.Column('geo_lng', sa.String(length=32), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('posts',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('title', sa.String(length=256), nullable=False),
    sa.Column('body', sa.Text(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('users', sa.Column('email', sa.String(length=32), nullable=True))
    op.add_column('users', sa.Column('fullname', sa.String(length=32), nullable=True))
    op.add_column('users', sa.Column('website', sa.String(length=128), nullable=True))
    op.drop_column('users', 'is_staff')
    op.drop_column('users', 'user_class')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('user_class', sa.VARCHAR(length=64), server_default=sa.text("'~'::character varying"), autoincrement=False, nullable=True))
    op.add_column('users', sa.Column('is_staff', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
    op.drop_column('users', 'website')
    op.drop_column('users', 'fullname')
    op.drop_column('users', 'email')
    op.drop_table('posts')
    op.drop_table('address')
    op.drop_table('company')
    # ### end Alembic commands ###
