2 Add support for by-hash with a new table and per-suite boolean
4 @contact: Debian FTP Master <ftpmaster@debian.org>
5 @copyright: 2016, Julien Cristau <jcristau@debian.org>
6 @license: GNU General Public License version 2 or later
10 from daklib.dak_exceptions import DBUpdateError
11 from daklib.config import Config
14 """Add column to store whether to generate by-hash things per suite,
15 add table to store when by-hash files stopped being referenced
21 c.execute("ALTER TABLE suite ADD COLUMN byhash BOOLEAN DEFAULT false")
24 CREATE TABLE hashfile (
25 suite_id INTEGER NOT NULL REFERENCES suite(id) ON DELETE CASCADE,
27 unreferenced TIMESTAMP,
28 PRIMARY KEY (suite_id, path)
32 c.execute("UPDATE config SET value = '116' WHERE name = 'db_revision'")
36 except psycopg2.ProgrammingError as msg:
38 raise DBUpdateError('Unable to apply sick update 116, rollback issued. Error message : %s' % (str(msg)))