"""empty message

Revision ID: e97a1704833e
Revises: 6f9a6e97afd4
Create Date: 2021-06-09 21:11:11.389848

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e97a1704833e'
down_revision = '6f9a6e97afd4'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('ad',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('title', sa.VARCHAR(), nullable=False),
    sa.Column('text', sa.VARCHAR(), nullable=False),
    sa.Column('price', sa.Integer(), nullable=True),
    sa.Column('is_active', sa.Boolean(), nullable=False, default=True),
    sa.Column('owner', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['owner'], ['person.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('person', sa.Column('first_name', sa.VARCHAR(), nullable=False))
    op.add_column('person', sa.Column('last_name', sa.VARCHAR(), nullable=False))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('person', 'last_name')
    op.drop_column('person', 'first_name')
    op.drop_table('ad')
    # ### end Alembic commands ###
