1"""add `dsc_files.include_in_indices`
3@contact: Debian FTP Master <ftpmaster@debian.org>
4@copyright: 2025 Ansgar <ansgar@debian.org>
5@license: GNU General Public License version 2 or later
6"""
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22################################################################################
24import psycopg2
26from daklib.dak_exceptions import DBUpdateError
28statements = [
29 """
30 ALTER TABLE dsc_files
31 ADD COLUMN extra_file BOOLEAN NOT NULL DEFAULT TRUE
32 """,
33 """
34 COMMENT ON COLUMN dsc_files.extra_file
35 IS 'additional file not part of the .dsc that should be considered part of the source'
36 """,
37]
39################################################################################
42def do_update(self):
43 print(__doc__)
44 try:
45 c = self.db.cursor()
47 for stmt in statements:
48 c.execute(stmt)
50 c.execute("UPDATE config SET value = '128' WHERE name = 'db_revision'")
51 self.db.commit()
53 except psycopg2.ProgrammingError as msg:
54 self.db.rollback()
55 raise DBUpdateError(
56 "Unable to apply sick update 128, rollback issued. Error message: {0}".format(
57 msg
58 )
59 )