Repository: fedora-infra/bodhi

Issue:
Remove deprecated Update.old_updateid
SSIA


Discussion:

Resolving patch:
diff --git a/bodhi/server/migrations/versions/f8a44498c806_remove_legacy_old_updateid.py b/bodhi/server/migrations/versions/f8a44498c806_remove_legacy_old_updateid.py
new file mode 100644
--- /dev/null
+++ b/bodhi/server/migrations/versions/f8a44498c806_remove_legacy_old_updateid.py
@@ -0,0 +1,41 @@
+# Copyright (c) 2019 Sebastian Wojciechowski.
+#
+# This file is part of Bodhi.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+"""
+Remove legacy old_updateid.
+
+Revision ID: f8a44498c806
+Revises: 8e9dc57e082d
+Create Date: 2019-01-11 18:34:04.277123
+"""
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = 'f8a44498c806'
+down_revision = '8e9dc57e082d'
+
+
+def upgrade():
+    """Remove database column old_updateid."""
+    op.drop_column('updates', 'old_updateid')
+
+
+def downgrade():
+    """Restore old_updateid field removed in the upgrade() function."""
+    op.add_column('updates', sa.Column('old_updateid', sa.Unicode(length=32), nullable=True))
diff --git a/bodhi/server/models.py b/bodhi/server/models.py
--- a/bodhi/server/models.py
+++ b/bodhi/server/models.py
@@ -1668,7 +1668,6 @@ class Update(Base):
         date_stable (DateTime): The date the update was placed into the stable repository or
             ``None``.
         alias (unicode): The update alias (e.g. FEDORA-EPEL-2009-12345).
-        old_updateid (unicode): The legacy update ID which has been deprecated.
         release_id (int): A foreign key to the releases ``id``.
         release (Release): The ``Release`` object this update relates to via the ``release_id``.
         comments (sqlalchemy.orm.collections.InstrumentedList): A list of the :class:`Comment`
@@ -1737,9 +1736,6 @@ class Update(Base):
     # eg: FEDORA-EPEL-2009-12345
     alias = Column(Unicode(32), unique=True, nullable=True)
 
-    # deprecated: our legacy update ID
-    old_updateid = Column(Unicode(32), default=None)
-
     # One-to-one relationships
     release_id = Column(Integer, ForeignKey('releases.id'), nullable=False)
     release = relationship('Release', lazy='joined')


Test patch:
diff --git a/bodhi/tests/client/__init__.py b/bodhi/tests/client/__init__.py
--- a/bodhi/tests/client/__init__.py
+++ b/bodhi/tests/client/__init__.py
@@ -23,7 +23,7 @@
         u'bug_feedback': [], u'user_id': 2897, u'author': u'bowlofeggs',
         u'timestamp': u'2017-02-28 18:08:13', u'testcase_feedback': [], u'karma_critpath': 0,
         u'update': Munch({
-            u'date_testing': u'2017-02-13 22:56:06', u'old_updateid': None, u'pushed': True,
+            u'date_testing': u'2017-02-13 22:56:06', u'pushed': True,
             u'require_testcases': False, u'date_stable': None, u'critpath': False,
             u'date_approved': None, u'stable_karma': 3, u'date_pushed': u'2017-02-13 22:56:06',
             u'requirements': u'', u'severity': u'low', u'autokarma': True,
@@ -258,7 +258,6 @@
         u'locked': False,
         u'meets_testing_requirements': True,
         u'notes': u'New package.',
-        u'old_updateid': None,
         u'pushed': True,
         u'release': {u'branch': u'f25',
                      u'candidate_tag': u'f25-updates-candidate',
@@ -363,7 +362,6 @@
         u'locked': False,
         u'meets_testing_requirements': True,
         u'notes': u'New package.',
-        u'old_updateid': None,
         u'pushed': True,
         u'release': {u'branch': u'f25',
                      u'candidate_tag': u'f25-updates-candidate',
@@ -430,7 +428,6 @@
         u'locked': False,
         u'meets_testing_requirements': True,
         u'notes': u'New package.',
-        u'old_updateid': None,
         u'pushed': True,
         u'release': {u'branch': u'f25',
                      u'candidate_tag': u'f25-updates-candidate',
@@ -718,7 +715,7 @@
 
 
 EXAMPLE_UPDATE_MUNCH = Munch({
-    u'date_testing': u'2016-10-06 00:55:15', u'old_updateid': None, u'pushed': True,
+    u'date_testing': u'2016-10-06 00:55:15', u'pushed': True,
     u'require_testcases': True, u'date_locked': None, u'critpath': False, u'date_approved': None,
     u'stable_karma': 3, u'date_pushed': u'2016-10-21 13:23:01', u'requirements': u'',
     u'severity': u'unspecified', u'autokarma': True, u'title': u'bodhi-2.2.4-1.el7',
@@ -773,7 +770,7 @@
 
 SINGLE_UPDATE_MUNCH = Munch({
     u'update': Munch({
-        u'date_testing': u'2016-10-06 00:55:15', u'old_updateid': None, u'pushed': True,
+        u'date_testing': u'2016-10-06 00:55:15', u'pushed': True,
         u'require_testcases': True, u'date_locked': None,
         u'critpath': False, u'date_approved': None,
         u'stable_karma': 3, u'date_pushed': u'2016-10-21 13:23:01', u'requirements': u'',