]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
database changes are hard. thats why we do them now.
authorHolger Levsen <holger@layer-acht.org>
Wed, 26 Sep 2012 16:29:06 +0000 (18:29 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 26 Sep 2012 16:29:06 +0000 (18:29 +0200)
debian_build.py

index 168ff5bffb3cb7170802d7eade9e74e05e014c42..72bcb767eb9ae0d6dada0625e6de6f45c2a32dab 100755 (executable)
@@ -161,15 +161,15 @@ def db_add_package(con, package):
         #logger.debug("INSERT INTO deb_package(name) VALUES('%s') RETURNING id" % (package))
     return cur.fetchone()[0]
 
-def db_add_package_instance(con, package_id, origin_id, build_id, version):
+def db_add_package_instance(con, package_id, origin_id, build_result_id, version):
     cur = con.cursor()
     cur.execute("SAVEPOINT a")
     try:
-        cur.execute("INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_id, version, available) VALUES(%s, %s, %s, '%s', 'true') RETURNING id" % (package_id, origin_id, build_id, version)) 
+        cur.execute("INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_result_id, version, available) VALUES(%s, %s, %s, '%s', 'true') RETURNING id" % (package_id, origin_id, build_result_id, version)) 
     except psycopg2.DatabaseError as e:
     # record already exist - this MUST NOT HAPPEN
         cur.execute("ROLLBACK TO a")  # have to rollback after failed command
-        logger_error("FAILED: INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_id, version, available) VALUES(%s, %s, %s, '%s', 'true') RETURNING id" % (package_id, origin_id, build_id, version))
+        logger_error("FAILED: INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_result_id, version, available) VALUES(%s, %s, %s, '%s', 'true') RETURNING id" % (package_id, origin_id, build_result_id, version))
         exit_error()
     return cur.fetchone()[0]