X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fupdate_db.py;h=8bb88f65c41a71685a7b2aff385bd82fba374992;hb=cd5b29ddfd8de263c085f494b9573d683913f6f3;hp=e9f8441d63dc31110509bc0faaea97f7f5988fc5;hpb=0952a111218688c6b3c29c7d25a94b526699ecfb;p=dak.git diff --git a/dak/update_db.py b/dak/update_db.py index e9f8441d..8bb88f65 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Debian Archive Kit Database Update Script +""" Database Update Main Script """ # Copyright (C) 2008 Michael Casadevall # This program is free software; you can redistribute it and/or modify @@ -37,7 +37,7 @@ from daklib import utils Cnf = None projectB = None -required_database_schema = 3 +required_database_schema = 4 ################################################################################ @@ -53,7 +53,7 @@ Updates dak's database schema to the lastest version. You should disable crontab ################################################################################ def update_db_to_zero(self): - # This function will attempt to update a pre-zero database schema to zero + """ This function will attempt to update a pre-zero database schema to zero """ # First, do the sure thing, and create the configuration table try: @@ -64,7 +64,7 @@ Updates dak's database schema to the lastest version. You should disable crontab name TEXT UNIQUE NOT NULL, value TEXT );""") - c.execute("INSERT INTO config VALUES ( nextval('config_id_seq'), 'db_revision', '0')"); + c.execute("INSERT INTO config VALUES ( nextval('config_id_seq'), 'db_revision', '0')") self.db.commit() except psycopg2.ProgrammingError: @@ -85,7 +85,7 @@ Updates dak's database schema to the lastest version. You should disable crontab try: c = self.db.cursor() - q = c.execute("SELECT value FROM config WHERE name = 'db_revision';"); + q = c.execute("SELECT value FROM config WHERE name = 'db_revision';") return c.fetchone()[0] except psycopg2.ProgrammingError: