# flake8: noqa
"""init

Revision ID: 38c2405af3fb
Revises: None
Create Date: 2014-06-23 12:37:42.817668

"""

# revision identifiers, used by Alembic.
revision = '38c2405af3fb'
down_revision = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

from treestore.db.sqltypes import LTree

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('treenodes',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('canonical_path', LTree(), nullable=False),
    sa.Column('values', postgresql.HSTORE(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('canonical_path')
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('treenodes')
    ### end Alembic commands ###
