From 107190c48837e736d316d3a1f77f6f1e4be4702d Mon Sep 17 00:00:00 2001 From: Valerij Maljulin Date: Oct 26 2020 13:44:24 +0000 Subject: [PATCH 1/2] Add scenario field to the database JIRA: RHELWF-1854 --- diff --git a/waiverdb/models/waivers.py b/waiverdb/models/waivers.py index bd5a1ac..0e1fbae 100644 --- a/waiverdb/models/waivers.py +++ b/waiverdb/models/waivers.py @@ -50,6 +50,7 @@ class Waiver(db.Model): proxied_by = db.Column(db.String(255)) product_version = db.Column(db.String(200), nullable=False) waived = db.Column(db.Boolean, nullable=False, default=False) + scenario = db.Column(db.String(255), nullable=True) comment = db.Column(db.Text) timestamp = db.Column(db.DateTime, default=datetime.datetime.utcnow) __table_args__ = ( From afa1d913f1589a5187a9d3a52e4cd06a91aad973 Mon Sep 17 00:00:00 2001 From: Valerij Maljulin Date: Oct 26 2020 13:46:25 +0000 Subject: [PATCH 2/2] Add migration script for the scenario field JIRA: RHELWF-1854 --- diff --git a/waiverdb/migrations/versions/3868a8118458_add_scenario_field_to_the_database.py b/waiverdb/migrations/versions/3868a8118458_add_scenario_field_to_the_database.py new file mode 100644 index 0000000..64eeaf1 --- /dev/null +++ b/waiverdb/migrations/versions/3868a8118458_add_scenario_field_to_the_database.py @@ -0,0 +1,22 @@ +"""Add scenario field to the database + +Revision ID: 3868a8118458 +Revises: f6bc296ba966 +Create Date: 2020-10-20 18:08:50.709804 + +""" + +# revision identifiers, used by Alembic. +revision = '3868a8118458' +down_revision = 'f6bc296ba966' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.add_column('waiver', sa.Column('scenario', sa.String(length=255), nullable=True)) + + +def downgrade(): + op.drop_column('waiver', 'scenario')