"""empty message

Revision ID: 366634ee7eec
Revises: None
Create Date: 2014-04-07 11:53:04.118553

"""

# revision identifiers, used by Alembic.
revision = '366634ee7eec'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('repo',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('path', sa.String(length=120), nullable=True),
    sa.Column('comment', sa.Text(), nullable=True),
    sa.Column('created_on', sa.DateTime(timezone=True), nullable=True),
    sa.Column('updated_on', sa.DateTime(timezone=True), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_repo_name'), 'repo', ['name'], unique=True)
    op.create_index(op.f('ix_repo_path'), 'repo', ['path'], unique=True)
    op.create_table('snapshot',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('path', sa.String(length=120), nullable=True),
    sa.Column('type', sa.String(length=64), nullable=True),
    sa.Column('repo_id', sa.Integer(), nullable=False),
    sa.Column('created_on', sa.DateTime(timezone=True), nullable=True),
    sa.ForeignKeyConstraint(['repo_id'], ['repo.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_snapshot_name'), 'snapshot', ['name'], unique=True)
    op.create_index(op.f('ix_snapshot_path'), 'snapshot', ['path'], unique=True)
    op.create_index(op.f('ix_snapshot_repo_id'), 'snapshot', ['repo_id'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_snapshot_repo_id'), table_name='snapshot')
    op.drop_index(op.f('ix_snapshot_path'), table_name='snapshot')
    op.drop_index(op.f('ix_snapshot_name'), table_name='snapshot')
    op.drop_table('snapshot')
    op.drop_index(op.f('ix_repo_path'), table_name='repo')
    op.drop_index(op.f('ix_repo_name'), table_name='repo')
    op.drop_table('repo')
    ### end Alembic commands ###
