#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]