"""adding versions to applications

Revision ID: e1904bcc877e
Revises: cfe73e8fa678
Create Date: 2016-09-16 13:37:33.923343

"""

# revision identifiers, used by Alembic.
revision = 'e1904bcc877e'
down_revision = 'cfe73e8fa678'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('versions',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('spec', sa.String(), nullable=False),
    sa.Column('created_on', sa.DateTime(), nullable=False),
    sa.Column('application_id', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['application_id'], ['applications.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_versions_id'), 'versions', ['id'], unique=True)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_versions_id'), table_name='versions')
    op.drop_table('versions')
    ### end Alembic commands ###
