From 9e003db0d122028dc633d42f06616e1ac02f22ac Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sun, 19 Sep 2010 15:57:26 +0200 Subject: [PATCH] Remove unused columns Signed-off-by: Joerg Jaspert --- config/debian/dak.conf | 2 -- dak/dakdb/update37.py | 57 ++++++++++++++++++++++++++++++++++++++++++ dak/update_db.py | 2 +- daklib/dbconn.py | 4 +-- docs/README.quotes | 8 ------ 5 files changed, 59 insertions(+), 14 deletions(-) create mode 100755 dak/dakdb/update37.py diff --git a/config/debian/dak.conf b/config/debian/dak.conf index 718bdc24..0ba61e39 100644 --- a/config/debian/dak.conf +++ b/config/debian/dak.conf @@ -195,7 +195,6 @@ Suite contrib; non-free; }; - ChangeLogBase "dists/stable/"; }; Proposed-Updates @@ -207,7 +206,6 @@ Suite non-free; }; CopyChanges "dists/proposed-updates/"; - CopyDotDak "/srv/ftp-master.debian.org/queue/proposed-updates/"; CommentsDir "/srv/ftp-master.debian.org/queue/p-u-new/COMMENTS/"; OverrideSuite "stable"; ValidTime 604800; // 7 days diff --git a/dak/dakdb/update37.py b/dak/dakdb/update37.py new file mode 100755 index 00000000..5a6714bb --- /dev/null +++ b/dak/dakdb/update37.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# coding=utf8 + +""" +Remove unused table columns + +@contact: Debian FTP Master +@copyright: 2010 Joerg Jaspert +@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 + +################################################################################ + + +# everyone - send your condolences to twerner, a new ftpmaster +# twerner: you poor, poor bastard +# twerner: look what it's done to me and Ganneff +# he used to be only 1.3m tall and I used to be female +# twerner: Congratulations... Uhm... Thorsta? +# Thorstine? +# 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)) diff --git a/dak/update_db.py b/dak/update_db.py index bfd05fe7..10466070 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -45,7 +45,7 @@ from daklib.dak_exceptions import DBUpdateError ################################################################################ Cnf = None -required_database_schema = 36 +required_database_schema = 37 ################################################################################ diff --git a/daklib/dbconn.py b/daklib/dbconn.py index fab0870e..817afb26 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -2483,10 +2483,8 @@ SUITE_FIELDS = [ ('SuiteName', 'suite_name'), ('Priority', 'priority'), ('NotAutomatic', 'notautomatic'), ('CopyChanges', 'copychanges'), - ('CopyDotDak', 'copydotdak'), ('CommentsDir', 'commentsdir'), - ('OverrideSuite', 'overridesuite'), - ('ChangelogBase', 'changelogbase')] + ('OverrideSuite', 'overridesuite')] class Suite(object): def __init__(self, *args, **kwargs): diff --git a/docs/README.quotes b/docs/README.quotes index 411ff8db..3568ae7a 100644 --- a/docs/README.quotes +++ b/docs/README.quotes @@ -344,11 +344,3 @@ Canadians: This is a lighthouse. Your call. elmo: I can't believe people pay you to fix computers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - everyone - send your condolences to twerner, a new ftpmaster - twerner: you poor, poor bastard - twerner: look what it's done to me and Ganneff - he used to be only 1.3m tall and I used to be female - twerner: Congratulations... Uhm... Thorsta? - Thorstine? - Thorstine seems the name of a candy we eat in Italy -- 2.39.5