"""add crash table

Revision ID: 8c237d2acbc4
Revises: eec6e5667b87
Create Date: 2020-12-01 15:04:15.172873

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8c237d2acbc4'
down_revision = 'eec6e5667b87'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('crash',
    sa.Column('time', sa.Integer(), nullable=False),
    sa.Column('trial_id', sa.Integer(), nullable=False),
    sa.Column('crash_key', sa.String(), nullable=False),
    sa.Column('crash_type', sa.String(), nullable=False),
    sa.Column('crash_address', sa.String(), nullable=False),
    sa.Column('crash_state', sa.String(), nullable=False),
    sa.Column('crash_stacktrace', sa.String(), nullable=False),
    sa.Column('crash_testcase', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['time', 'trial_id'], ['snapshot.time', 'snapshot.trial_id'], ),
    sa.PrimaryKeyConstraint('time', 'trial_id', 'crash_key')
    )
    # ### end Alembic commands ###


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