From 5f12c9c32e677b3ccf1fb1e2093635fd60637675 Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Tue, 6 Feb 2018 11:36:21 -0500 Subject: [PATCH] fixes bug 1219483 - remove exploitability_reports table --- ...bug_1219483_remove_exploitability_table.py | 24 ++++++++++++++ socorro/external/postgresql/models.py | 31 ------------------- 2 files changed, 24 insertions(+), 31 deletions(-) create mode 100644 alembic/versions/0f31c225e765_bug_1219483_remove_exploitability_table.py diff --git a/alembic/versions/0f31c225e765_bug_1219483_remove_exploitability_table.py b/alembic/versions/0f31c225e765_bug_1219483_remove_exploitability_table.py new file mode 100644 index 0000000000..77c2fb438a --- /dev/null +++ b/alembic/versions/0f31c225e765_bug_1219483_remove_exploitability_table.py @@ -0,0 +1,24 @@ +"""bug 1219483 remove exploitability table + +Revision ID: 0f31c225e765 +Revises: 0193b4725f32 +Create Date: 2018-02-06 16:33:54.841669 + +""" + +from alembic import op + + +# revision identifiers, used by Alembic. +revision = '0f31c225e765' +down_revision = '0193b4725f32' + + +def upgrade(): + # Delete exploitability_table table + op.execute('DROP TABLE IF EXISTS exploitability_reports') + + +def downgrade(): + # There is no going back. + pass diff --git a/socorro/external/postgresql/models.py b/socorro/external/postgresql/models.py index ab8e094757..3236f8e481 100644 --- a/socorro/external/postgresql/models.py +++ b/socorro/external/postgresql/models.py @@ -313,37 +313,6 @@ class Module(DeclarativeBase): version = Column(u'version', TEXT(), nullable=False, primary_key=True) -class ExploitabilityReport(DeclarativeBase): - __tablename__ = 'exploitability_reports' - - # column definitions - signature_id = Column(u'signature_id', INTEGER(), ForeignKey( - 'signatures.signature_id'), nullable=False) - product_version_id = Column(u'product_version_id', INTEGER(), ForeignKey( - 'product_versions.product_version_id'), nullable=False) - product_name = Column(u'product_name', TEXT()) - version_string = Column(u'version_string', TEXT()) - signature = Column(u'signature', TEXT(), nullable=False) - report_date = Column(u'report_date', DATE(), nullable=False, index=True) - null_count = Column(u'null_count', INTEGER(), - nullable=False, server_default=text('0')) - none_count = Column(u'none_count', INTEGER(), - nullable=False, server_default=text('0')) - low_count = Column(u'low_count', INTEGER(), - nullable=False, server_default=text('0')) - medium_count = Column(u'medium_count', INTEGER(), - nullable=False, server_default=text('0')) - high_count = Column(u'high_count', INTEGER(), - nullable=False, server_default=text('0')) - - __mapper_args__ = {"primary_key": ( - signature_id, product_version_id, report_date)} - __table_args__ = ( - Index('exploitable_signature_date_idx', signature_id, - product_version_id, report_date, unique=True), - ) - - class RawAdiLogs(DeclarativeBase): __tablename__ = 'raw_adi_logs'