5 Add a component - suite mapping to only expose certain components in certain suites
7 @contact: Debian FTP Master <ftpmaster@debian.org>
8 @copyright: 2012 Varnish Software AS
9 @author: Tollef Fog Heen <tfheen@varnish-software.com>
10 @license: GNU General Public License version 2 or later
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 ################################################################################
30 from daklib.dak_exceptions import DBUpdateError
31 from daklib.config import Config
33 ################################################################################
42 CREATE TABLE component_suite (
43 component_id INTEGER NOT NULL REFERENCES component(id) ON DELETE CASCADE,
44 suite_id INTEGER NOT NULL REFERENCES suite(id) ON DELETE CASCADE,
45 PRIMARY KEY (component_id, suite_id)
48 # Set up default mappings for all components to all suites
49 c.execute("INSERT INTO component_suite(component_id, suite_id) SELECT component.id,suite.id from suite, component")
51 c.execute("UPDATE config SET value = '100' WHERE name = 'db_revision'")
54 except psycopg2.ProgrammingError as msg:
56 raise DBUpdateError('Unable to apply sick update 100, rollback issued. Error message: {0}'.format(msg))