From: Joerg Jaspert Date: Sun, 18 Jan 2009 16:13:45 +0000 (+0100) Subject: update2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b155c08a04d9cf3c415b00b999e1e9a680735258;p=dak update2 also create the perl language. We are database superuser, we can do so. And then set config value to 2, this is update 2. Signed-off-by: Joerg Jaspert --- diff --git a/dak/dakdb/update2.py b/dak/dakdb/update2.py old mode 100644 new mode 100755 index bddf0a70..12fe4f17 --- a/dak/dakdb/update2.py +++ b/dak/dakdb/update2.py @@ -26,12 +26,18 @@ import psycopg2, time ################################################################################ def do_update(self): - print "Note the PL/Perl (plperl) procedural language must be enabled first." - print "Run 'createlang plpgsql projectb' to add it." + print "Note: to be able to enable the the PL/Perl (plperl) procedural language, we do" + print "need postgresql-plperl-$postgres-version installed. Make sure that this is the" + print "case before you continue. Interrupt if it isn't, sleeping 5 seconds now." + print "(We need to be database superuser for this to work!)" + time.sleep (5) try: c = self.db.cursor() + print "Enabling PL/Perl language" + c.execute("CREATE LANGUAGE plpgsql;") + print "Adding debversion type to database." # Not present in all databases, maybe PL/Perl version-dependent? @@ -378,7 +384,7 @@ $$ c.execute("ALTER TABLE source ALTER COLUMN version TYPE debversion;") c.execute("ALTER TABLE binaries ALTER COLUMN version TYPE debversion;") - c.execute("UPDATE config SET value = '1' WHERE name = 'db_revision'") + c.execute("UPDATE config SET value = '2' WHERE name = 'db_revision'") self.db.commit()