[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Remove unused columns



Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
 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 718bdc2..0ba61e3 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 0000000..5a6714b
--- /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 <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))
diff --git a/dak/update_db.py b/dak/update_db.py
index bfd05fe..1046607 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 fab0870..817afb2 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 411ff8d..3568ae7 100644
--- a/docs/README.quotes
+++ b/docs/README.quotes
@@ -344,11 +344,3 @@ Canadians: This is a lighthouse. Your call.
 <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
-- 
1.5.6.5


Reply to: