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 usually only need a module docstring (its first non-empty
line is shown to the user) and a module-level statements sequence (a
list or tuple) of SQL statements:
statements = [
"ALTER TABLE suite ADD COLUMN mascot TEXT",
]
Update scripts that need more than a fixed sequence of SQL statements
define the function do_update(c) instead, which is called with an
open cursor and can do whatever it wants using everything from dak and
daklib:
def do_update(c: psycopg2.extensions.cursor) -> None:
c.execute("SOME SQL STATEMENT")
A script must not define both statements and do_update.
In both cases dak update-db prints the module docstring, runs the
statements or the function in a single transaction, updates
db_revision in the config table and commits. On any error the
transaction is rolled back: a psycopg2.ProgrammingError is
reported as a DBUpdateError; any other
exception is re-raised unchanged. do_update may raise
DBUpdateError itself to abort the update
with a friendly message.
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 authorized_by_fingerprint |
|
add dsc_files.include_in_indices |
|
add keyrings.tag2upload |
|
ensure merged_pdiffs is default for new suites |
|
Add stayofexecution to the suite 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 |