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
Add a component - suite mapping to only expose certain components in certain suites |
|
Add column to store compression type of indices |
|
src_associations_full view, now also including sources for all binaries |
|
Drop unique .changes name requirement and allow ftpteam to forget seen files |
|
Drop created and modified columns from bin_contents and src_contents |
|
Add a new release_suite name which we use in generate_releases |
|
new views binary_component, source_component and package_list |
|
Do not include long description in Packages index by default |
|
Add codename to package_list view |
|
Change indices for {src,bin}_contents |
|
Add a debug suite field to the suite table |
|
Make install_date in source consistant with binaries |
|
Add Changelogs field |
|
Add accept_{source,binary}_uploads to suite |
|
Add column to store checksums we want per suite (Packages/Release files) |
|
Add last_changed to suite |
|
Add support for by-hash with a new table and per-suite boolean |
|
list of external signature requests |
|
set owner tables for sequences |
|
remove unused database objects |
|
remove duplicate constraint |
|
Update changes table to not require a value for the Binary column |
|
Update default settings for suites |
|
Add separate Contents-all support settings for suites |
|
Put descriptions into sections table |
|
Add separate merged pdiff support settings for suites |
|
add per-suite ACL table |
|
Add support for Description-md5 |
|
Add suite options for overrides and control-suite to DB |
|
Make lastused in queuefiles/policyqueuefiles default now() |
|
Remove redundant indices |
|
Reference archive table from suite and add path to archive root |
|
Drop origin_server column from archive table |
|
Multi-archive support; convert policy and build queues to regular suites |
|
Add list of closed bugs to changes table |
|
Move stayofexecution to the database |
|
Alter permissions for new tables and set default permissions |
|
add world schema and new stable views |
|
rename policy queues |
|
Correct permissions of policy_queue_byhand_file_id_seq |
|
Correct permissions of policy_queue_upload_id_seq |
|
switch to new ACL implementation and add pre-suite NEW |
|
add per-suite database permissions |
|
add per-suite close_bugs option |
|
Unprivileged group into the database config table |
|
add external_files table for security |
|
add per-suite mail whitelists |
|
add table to keep track of seen signatures |
|
add created_by_id and created columns to acl_per_source table |
|
per-queue NEW comments and permissions |
|
remove per-fingerprint ACLs that are identical to keyring ACL |
|
update world.files-1 view to handle backports archive on ftp-master |
|
src_associations_full view |
|
Require SHA-1 and SHA-256 checksums in "files" table. |
|
Add world.suite_summary view. |
|
Create path entries for changelog exporting |
|
Remove obsolete functions |
|
Add component ordering |