--- /dev/null
+#!/usr/bin/env python
+# coding=utf8
+
+"""
+Remove unused table columns
+
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2010 Joerg Jaspert <joerg@debian.org>
+@license: GNU General Public License version 2 or later
+"""
+
+# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+################################################################################
+
+
+# <Ganneff> everyone - send your condolences to twerner, a new ftpmaster
+# <mhy> twerner: you poor, poor bastard
+# <mhy> twerner: look what it's done to me and Ganneff
+# <mhy> he used to be only 1.3m tall and I used to be female
+# <Tolimar> twerner: Congratulations... Uhm... Thorsta?
+# <Tolimar> Thorstine?
+# <DktrKranz> Thorstine seems the name of a candy we eat in Italy
+
+################################################################################
+
+import psycopg2
+from daklib.dak_exceptions import DBUpdateError
+
+################################################################################
+def do_update(self):
+ """
+ Remove unused table columns
+ """
+ print __doc__
+ try:
+ c = self.db.cursor()
+ c.execute('ALTER TABLE suite DROP COLUMN copydotdak')
+ c.execute('ALTER TABLE suite DROP COLUMN changelogbase')
+ c.execute("UPDATE config SET value = '37' WHERE name = 'db_revision'")
+ self.db.commit()
+
+ except psycopg2.ProgrammingError, msg:
+ self.db.rollback()
+ raise DBUpdateError, 'Unable to apply table-colum update 37, rollback issued. Error message : %s' % (str(msg))
('Priority', 'priority'),
('NotAutomatic', 'notautomatic'),
('CopyChanges', 'copychanges'),
- ('CopyDotDak', 'copydotdak'),
('CommentsDir', 'commentsdir'),
- ('OverrideSuite', 'overridesuite'),
- ('ChangelogBase', 'changelogbase')]
+ ('OverrideSuite', 'overridesuite')]
class Suite(object):
def __init__(self, *args, **kwargs):
<helix> elmo: I can't believe people pay you to fix computers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-<Ganneff> everyone - send your condolences to twerner, a new ftpmaster
-<mhy> twerner: you poor, poor bastard
-<mhy> twerner: look what it's done to me and Ganneff
-<mhy> he used to be only 1.3m tall and I used to be female
-<Tolimar> twerner: Congratulations... Uhm... Thorsta?
-<Tolimar> Thorstine?
-<DktrKranz> Thorstine seems the name of a candy we eat in Italy