"""Add missing tag manifest table

Revision ID: 2e09ad97b06c
Revises: 2bf8af5bad95
Create Date: 2015-07-22 16:10:42.549566

"""

# revision identifiers, used by Alembic.
revision = '2e09ad97b06c'
down_revision = '2bf8af5bad95'

from alembic import op
import sqlalchemy as sa


def upgrade(tables):
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tagmanifest',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('tag_id', sa.Integer(), nullable=False),
    sa.Column('digest', sa.String(length=255), nullable=False),
    sa.Column('json_data', sa.Text(), nullable=False),
    sa.ForeignKeyConstraint(['tag_id'], ['repositorytag.id'], name=op.f('fk_tagmanifest_tag_id_repositorytag')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_tagmanifest'))
    )
    op.create_index('tagmanifest_digest', 'tagmanifest', ['digest'], unique=True)
    op.create_index('tagmanifest_tag_id', 'tagmanifest', ['tag_id'], unique=True)
    ### end Alembic commands ###


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