dak.dakdbΒΆ

Database update scripts for usage with dak update-db

@contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2008 Michael Casadevall <mcasadevall@debian.org> @license: GNU General Public License version 2 or later

Update scripts have to import psycopg2 and from daklib.dak_exceptions import DBUpdateError.

There has to be at least the function do_update(self) to be defined. It should take all neccessary steps to update the database. If the update fails the changes have to be rolled back and the DBUpdateError exception raised to properly halt the execution of any other update.

Example:

def do_update(self):
    print("Doing something")

    try:
        c = self.db.cursor()
        c.execute("SOME SQL STATEMENT")
        self.db.commit()

    except psycopg2.ProgrammingError as msg:
        self.db.rollback()
        raise DBUpdateError(f"Unable to do whatever, rollback issued. Error message: {msg}")

This function can do whatever it wants and use everything from dak and daklib.

Modules

update100

Add a component - suite mapping to only expose certain components in certain suites

update101

Add column to store compression type of indices

update102

src_associations_full view, now also including sources for all binaries

update103

Drop unique .changes name requirement and allow ftpteam to forget seen files

update104

Drop created and modified columns from bin_contents and src_contents

update105

Add a new release_suite name which we use in generate_releases

update106

new views binary_component, source_component and package_list

update107

Do not include long description in Packages index by default

update108

Add codename to package_list view

update109

Change indices for {src,bin}_contents

update110

Add a debug suite field to the suite table

update111

Make install_date in source consistant with binaries

update112

Add Changelogs field

update113

Add accept_{source,binary}_uploads to suite

update114

Add column to store checksums we want per suite (Packages/Release files)

update115

Add last_changed to suite

update116

Add support for by-hash with a new table and per-suite boolean

update117

list of external signature requests

update118

set owner tables for sequences

update119

remove unused database objects

update120

remove duplicate constraint

update121

Update changes table to not require a value for the Binary column

update122

Update default settings for suites

update123

Add separate Contents-all support settings for suites

update124

Put descriptions into sections table

update125

Add separate merged pdiff support settings for suites

update126

add per-suite ACL table

update127

add authorized_by_fingerprint

update128

add dsc_files.include_in_indices

update129

add keyrings.tag2upload

update130

ensure merged_pdiffs is default for new suites

update131

Add stayofexecution to the suite table

update69

Add support for Description-md5

update70

Add suite options for overrides and control-suite to DB

update71

Make lastused in queuefiles/policyqueuefiles default now()

update72

Remove redundant indices

update73

Reference archive table from suite and add path to archive root

update74

Drop origin_server column from archive table

update75

Multi-archive support; convert policy and build queues to regular suites

update76

Add list of closed bugs to changes table

update77

Move stayofexecution to the database

update78

Alter permissions for new tables and set default permissions

update79

add world schema and new stable views

update80

rename policy queues

update81

Correct permissions of policy_queue_byhand_file_id_seq

update82

Correct permissions of policy_queue_upload_id_seq

update83

switch to new ACL implementation and add pre-suite NEW

update84

add per-suite database permissions

update85

add per-suite close_bugs option

update86

Unprivileged group into the database config table

update87

add external_files table for security

update88

add per-suite mail whitelists

update89

add table to keep track of seen signatures

update90

add created_by_id and created columns to acl_per_source table

update91

per-queue NEW comments and permissions

update92

remove per-fingerprint ACLs that are identical to keyring ACL

update93

update world.files-1 view to handle backports archive on ftp-master

update94

src_associations_full view

update95

Require SHA-1 and SHA-256 checksums in "files" table.

update96

Add world.suite_summary view.

update97

Create path entries for changelog exporting

update98

Remove obsolete functions

update99

Add component ordering