"""empty message

Revision ID: bc703f360e41
Revises: 2e7406a3c18e
Create Date: 2019-04-19 13:54:13.487574

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'bc703f360e41'
down_revision = '2e7406a3c18e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tree_levels',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=250), nullable=False),
    sa.Column('creation_date', sa.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('trees', sa.Column('level_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'trees', 'tree_levels', ['level_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'trees', type_='foreignkey')
    op.drop_column('trees', 'level_id')
    op.drop_table('tree_levels')
    # ### end Alembic commands ###
