-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store detection status for the reports in the database.
- Loading branch information
Showing
13 changed files
with
596 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
"""detection_status | ||
Revision ID: 41c3d07202db | ||
Revises: 21a4ca1179da | ||
Create Date: 2017-07-23 17:15:23.289229 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '41c3d07202db' | ||
down_revision = '21a4ca1179da' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('bug_path_events', sa.Column('order', sa.Integer(), nullable=True)) | ||
op.add_column('bug_path_events', sa.Column('report_id', sa.Integer(), nullable=True)) | ||
op.create_index(op.f('ix_bug_path_events_report_id'), 'bug_path_events', ['report_id'], unique=False) | ||
op.create_foreign_key(op.f('fk_bug_path_events_report_id_reports'), 'bug_path_events', 'reports', ['report_id'], ['id'], ondelete=u'CASCADE', initially=u'DEFERRED', deferrable=True) | ||
op.drop_column('bug_path_events', 'prev') | ||
op.drop_column('bug_path_events', 'next') | ||
op.add_column('bug_report_points', sa.Column('order', sa.Integer(), nullable=True)) | ||
op.add_column('bug_report_points', sa.Column('report_id', sa.Integer(), nullable=True)) | ||
op.create_index(op.f('ix_bug_report_points_report_id'), 'bug_report_points', ['report_id'], unique=False) | ||
op.create_foreign_key(op.f('fk_bug_report_points_report_id_reports'), 'bug_report_points', 'reports', ['report_id'], ['id'], ondelete=u'CASCADE', initially=u'DEFERRED', deferrable=True) | ||
op.drop_column('bug_report_points', 'next') | ||
op.drop_constraint(u'fk_files_run_id_runs', 'files', type_='foreignkey') | ||
op.drop_column('files', 'inc_count') | ||
op.drop_column('files', 'run_id') | ||
op.add_column('reports', sa.Column('detection_status', sa.String(), nullable=True)) | ||
op.drop_index('ix_reports_end_bugevent', table_name='reports') | ||
op.drop_index('ix_reports_start_bugevent', table_name='reports') | ||
op.drop_constraint(u'fk_reports_start_bugpoint_bug_report_points', 'reports', type_='foreignkey') | ||
op.drop_constraint(u'fk_reports_start_bugevent_bug_path_events', 'reports', type_='foreignkey') | ||
op.drop_constraint(u'fk_reports_end_bugevent_bug_path_events', 'reports', type_='foreignkey') | ||
op.drop_column('reports', 'end_bugevent') | ||
op.drop_column('reports', 'start_bugpoint') | ||
op.drop_column('reports', 'start_bugevent') | ||
op.drop_column('runs', 'inc_count') | ||
### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('runs', sa.Column('inc_count', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.add_column('reports', sa.Column('start_bugevent', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.add_column('reports', sa.Column('start_bugpoint', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.add_column('reports', sa.Column('end_bugevent', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.create_foreign_key(u'fk_reports_end_bugevent_bug_path_events', 'reports', 'bug_path_events', ['end_bugevent'], ['id'], ondelete=u'CASCADE', initially=u'DEFERRED', deferrable=True) | ||
op.create_foreign_key(u'fk_reports_start_bugevent_bug_path_events', 'reports', 'bug_path_events', ['start_bugevent'], ['id'], ondelete=u'CASCADE', initially=u'DEFERRED', deferrable=True) | ||
op.create_foreign_key(u'fk_reports_start_bugpoint_bug_report_points', 'reports', 'bug_report_points', ['start_bugpoint'], ['id'], ondelete=u'CASCADE', initially=u'DEFERRED', deferrable=True) | ||
op.create_index('ix_reports_start_bugevent', 'reports', ['start_bugevent'], unique=False) | ||
op.create_index('ix_reports_end_bugevent', 'reports', ['end_bugevent'], unique=False) | ||
op.drop_column('reports', 'detection_status') | ||
op.add_column('files', sa.Column('run_id', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.add_column('files', sa.Column('inc_count', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.create_foreign_key(u'fk_files_run_id_runs', 'files', 'runs', ['run_id'], ['id'], ondelete=u'CASCADE', initially=u'DEFERRED', deferrable=True) | ||
op.add_column('bug_report_points', sa.Column('next', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.drop_constraint(op.f('fk_bug_report_points_report_id_reports'), 'bug_report_points', type_='foreignkey') | ||
op.drop_index(op.f('ix_bug_report_points_report_id'), table_name='bug_report_points') | ||
op.drop_column('bug_report_points', 'report_id') | ||
op.drop_column('bug_report_points', 'order') | ||
op.add_column('bug_path_events', sa.Column('next', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.add_column('bug_path_events', sa.Column('prev', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.drop_constraint(op.f('fk_bug_path_events_report_id_reports'), 'bug_path_events', type_='foreignkey') | ||
op.drop_index(op.f('ix_bug_path_events_report_id'), table_name='bug_path_events') | ||
op.drop_column('bug_path_events', 'report_id') | ||
op.drop_column('bug_path_events', 'order') | ||
### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.