"""cve_many_to_many

Revision ID: 5d7a930c439e
Revises: 18891ca61db6
Create Date: 2021-06-02 19:27:34.373988+00:00

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '5d7a930c439e'
down_revision = '247a90b029f2'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cve',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('year', sa.Integer(), nullable=True),
    sa.Column('identifier', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cve_association',
    sa.Column('vulnerability_id', sa.Integer(), nullable=False),
    sa.Column('cve_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['cve_id'], ['cve.id'], ),
    sa.ForeignKeyConstraint(['vulnerability_id'], ['vulnerability.id'], )
    )
    # ### end Alembic commands ###


def downgrade():
    #
    op.drop_table('cve_association')
    op.drop_table('cve')
    # ### end Alembic commands ###
