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

dak.dakdb.update100

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

dak.dakdb.update101

Add column to store compression type of indices

dak.dakdb.update102

src_associations_full view, now also including sources for all binaries

dak.dakdb.update103

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

dak.dakdb.update104

Drop created and modified columns from bin_contents and src_contents

dak.dakdb.update105

Add a new release_suite name which we use in generate_releases

dak.dakdb.update106

new views binary_component, source_component and package_list

dak.dakdb.update107

Do not include long description in Packages index by default

dak.dakdb.update108

Add codename to package_list view

dak.dakdb.update109

Change indices for {src,bin}_contents

dak.dakdb.update110

Add a debug suite field to the suite table

dak.dakdb.update111

Make install_date in source consistant with binaries

dak.dakdb.update112

Add Changelogs field

dak.dakdb.update113

Add accept_{source,binary}_uploads to suite

dak.dakdb.update114

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

dak.dakdb.update115

Add last_changed to suite

dak.dakdb.update116

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

dak.dakdb.update117

list of external signature requests

dak.dakdb.update118

set owner tables for sequences

dak.dakdb.update119

remove unused database objects

dak.dakdb.update120

remove duplicate constraint

dak.dakdb.update121

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

dak.dakdb.update122

Update default settings for suites

dak.dakdb.update123

Add separate Contents-all support settings for suites

dak.dakdb.update124

Put descriptions into sections table

dak.dakdb.update125

Add separate merged pdiff support settings for suites

dak.dakdb.update126

add per-suite ACL table

dak.dakdb.update69

Add support for Description-md5

dak.dakdb.update70

Add suite options for overrides and control-suite to DB

dak.dakdb.update71

Make lastused in queuefiles/policyqueuefiles default now()

dak.dakdb.update72

Remove redundant indices

dak.dakdb.update73

Reference archive table from suite and add path to archive root

dak.dakdb.update74

Drop origin_server column from archive table

dak.dakdb.update75

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

dak.dakdb.update76

Add list of closed bugs to changes table

dak.dakdb.update77

Move stayofexecution to the database

dak.dakdb.update78

Alter permissions for new tables and set default permissions

dak.dakdb.update79

add world schema and new stable views

dak.dakdb.update80

rename policy queues

dak.dakdb.update81

Correct permissions of policy_queue_byhand_file_id_seq

dak.dakdb.update82

Correct permissions of policy_queue_upload_id_seq

dak.dakdb.update83

switch to new ACL implementation and add pre-suite NEW

dak.dakdb.update84

add per-suite database permissions

dak.dakdb.update85

add per-suite close_bugs option

dak.dakdb.update86

Unprivileged group into the database config table

dak.dakdb.update87

add external_files table for security

dak.dakdb.update88

add per-suite mail whitelists

dak.dakdb.update89

add table to keep track of seen signatures

dak.dakdb.update90

add created_by_id and created columns to acl_per_source table

dak.dakdb.update91

per-queue NEW comments and permissions

dak.dakdb.update92

remove per-fingerprint ACLs that are identical to keyring ACL

dak.dakdb.update93

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

dak.dakdb.update94

src_associations_full view

dak.dakdb.update95

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

dak.dakdb.update96

Add world.suite_summary view.

dak.dakdb.update97

Create path entries for changelog exporting

dak.dakdb.update98

Remove obsolete functions

dak.dakdb.update99

Add component ordering