import logging
import os
import re
-import uuid
from . import base
from . import logs
priority = -1
# Create build in database
- build = self._get_build("INSERT INTO builds(uuid, pkg_id, type, distro_id, priority) \
- VALUES(%s, %s, %s, %s, %s) RETURNING *", "%s" % uuid.uuid4(), pkg.id, type, distro.id, priority)
+ build = self._get_build("INSERT INTO builds(pkg_id, type, distro_id, priority) \
+ VALUES(%s, %s, %s, %s) RETURNING *", pkg.id, type, distro.id, priority)
# Set the owner of this build
if owner:
import logging
import os
import shutil
-import uuid
import pakfire
import pakfire.config
yield Job(self.backend, row.id, data=row)
def create(self, build, arch, test=False, superseeds=None):
- job = self._get_job("INSERT INTO jobs(uuid, build_id, arch, test) \
- VALUES(%s, %s, %s, %s) RETURNING *", "%s" % uuid.uuid4(), build.id, arch, test)
+ job = self._get_job("INSERT INTO jobs(build_id, arch, test) \
+ VALUES(%s, %s, %s) RETURNING *", build.id, arch, test)
job.log("created")
# Set cache for Build object.
CREATE TABLE public.builds (
id integer NOT NULL,
- uuid text NOT NULL,
+ uuid uuid DEFAULT gen_random_uuid() NOT NULL,
pkg_id integer NOT NULL,
type text DEFAULT 'release'::text NOT NULL,
state text DEFAULT 'building'::text NOT NULL,
CREATE TABLE public.jobs (
id integer NOT NULL,
- uuid text NOT NULL,
+ uuid uuid DEFAULT gen_random_uuid() NOT NULL,
build_id integer NOT NULL,
state text DEFAULT 'pending'::text NOT NULL,
arch text NOT NULL,
CREATE TABLE public.jobs_buildroots (
job_id integer NOT NULL,
- pkg_uuid text NOT NULL,
+ pkg_uuid uuid NOT NULL,
pkg_name text NOT NULL
);
description text NOT NULL,
size bigint NOT NULL,
supported_arches text,
- uuid text NOT NULL,
+ uuid uuid NOT NULL,
commit_id integer,
build_id text NOT NULL,
build_host text NOT NULL,