Merge branch 'master' into mead

Conflicts:
	builder/kojid
	cli/koji
	hub/kojihub.py
	www/kojiweb/buildinfo.chtml
	www/kojiweb/builds.chtml
	www/kojiweb/index.py
This commit is contained in:
Mike McLean 2009-03-31 15:43:08 -04:00
commit f273899018
65 changed files with 3462 additions and 6470 deletions

View file

@ -7,8 +7,6 @@ DROP TABLE log_messages;
DROP TABLE buildroot_listing;
DROP TABLE rpmfiles;
DROP TABLE rpmdeps;
DROP TABLE rpminfo;
DROP TABLE group_package_listing;
@ -271,17 +269,6 @@ CREATE TABLE build (
CREATE INDEX build_by_pkg_id ON build (pkg_id);
CREATE INDEX build_completion ON build(completion_time);
CREATE TABLE changelogs (
id SERIAL NOT NULL PRIMARY KEY,
build_id INTEGER NOT NULL REFERENCES build (id),
date TIMESTAMP NOT NULL,
author TEXT NOT NULL,
text TEXT
) WITHOUT OIDS;
CREATE INDEX changelogs_by_date on changelogs (date);
CREATE INDEX changelogs_by_build on changelogs (build_id);
-- Note: some of these CREATEs may seem a little out of order. This is done to keep
-- the references sane.
@ -386,6 +373,43 @@ CREATE TABLE repo (
state INTEGER
) WITHOUT OIDS;
-- external yum repos
create table external_repo (
id SERIAL NOT NULL PRIMARY KEY,
name TEXT UNIQUE NOT NULL
);
-- fake repo id for internal stuff (needed for unique index)
INSERT INTO external_repo (id, name) VALUES (0, 'INTERNAL');
create table external_repo_config (
external_repo_id INTEGER NOT NULL REFERENCES external_repo(id),
url TEXT NOT NULL,
-- versioned - see earlier description of versioning
create_event INTEGER NOT NULL REFERENCES events(id) DEFAULT get_event(),
revoke_event INTEGER REFERENCES events(id),
active BOOLEAN DEFAULT 'true' CHECK (active),
CONSTRAINT active_revoke_sane CHECK (
(active IS NULL AND revoke_event IS NOT NULL )
OR (active IS NOT NULL AND revoke_event IS NULL )),
PRIMARY KEY (create_event, external_repo_id),
UNIQUE (external_repo_id, active)
) WITHOUT OIDS;
create table tag_external_repos (
tag_id INTEGER NOT NULL REFERENCES tag(id),
external_repo_id INTEGER NOT NULL REFERENCES external_repo(id),
priority INTEGER NOT NULL,
-- versioned - see earlier description of versioning
create_event INTEGER NOT NULL REFERENCES events(id) DEFAULT get_event(),
revoke_event INTEGER REFERENCES events(id),
active BOOLEAN DEFAULT 'true' CHECK (active),
CONSTRAINT active_revoke_sane CHECK (
(active IS NULL AND revoke_event IS NOT NULL )
OR (active IS NOT NULL AND revoke_event IS NULL )),
PRIMARY KEY (create_event, tag_id, priority),
UNIQUE (tag_id, priority, active),
UNIQUE (tag_id, external_repo_id, active)
);
-- here we track the buildroots on the machines
CREATE TABLE buildroot (
@ -525,10 +549,11 @@ CREATE TABLE rpminfo (
release TEXT NOT NULL,
epoch INTEGER,
arch VARCHAR(16) NOT NULL,
external_repo_id INTEGER NOT NULL REFERENCES external_repo(id),
payloadhash TEXT NOT NULL,
size INTEGER NOT NULL,
size BIGINT NOT NULL,
buildtime BIGINT NOT NULL,
CONSTRAINT rpminfo_unique_nvra UNIQUE (name,version,release,arch)
CONSTRAINT rpminfo_unique_nvra UNIQUE (name,version,release,arch,external_repo_id)
) WITHOUT OIDS;
CREATE INDEX rpminfo_build ON rpminfo(build_id);
@ -549,32 +574,6 @@ CREATE TABLE buildroot_listing (
) WITHOUT OIDS;
CREATE INDEX buildroot_listing_rpms ON buildroot_listing(rpm_id);
-- this table holds the requires, provides, obsoletes, and conflicts
-- for an rpminfo entry
CREATE TABLE rpmdeps (
pkey SERIAL NOT NULL PRIMARY KEY,
rpm_id INTEGER NOT NULL REFERENCES rpminfo (id),
dep_name TEXT NOT NULL,
dep_version TEXT,
dep_flags INTEGER,
dep_type INTEGER NOT NULL
) WITHOUT OIDS;
CREATE INDEX rpmdeps_by_rpm_id ON rpmdeps (rpm_id);
CREATE INDEX rpmdeps_by_depssolve ON rpmdeps (dep_type, dep_name, dep_flags, dep_version);
CREATE TABLE rpmfiles (
rpm_id INTEGER NOT NULL REFERENCES rpminfo (id),
filename TEXT NOT NULL,
filemd5 VARCHAR(32) NOT NULL,
filesize INTEGER NOT NULL,
fileflags INTEGER NOT NULL,
PRIMARY KEY (filename, rpm_id)
) WITHOUT OIDS;
CREATE INDEX rpmfiles_by_rpm_id ON rpmfiles (rpm_id);
CREATE INDEX rpmfiles_by_filename ON rpmfiles (filename);
CREATE TABLE log_messages (
id SERIAL NOT NULL PRIMARY KEY,
message TEXT NOT NULL,
@ -596,8 +595,7 @@ CREATE TABLE build_notifications (
GRANT SELECT ON build, package, task, tag,
tag_listing, tag_config, tag_inheritance, tag_packages,
rpminfo, rpmdeps,
rpmfiles TO PUBLIC;
rpminfo TO PUBLIC;
-- example code to add initial admins
-- insert into users (name, usertype, status, krb_principal) values ('admin', 0, 0, 'admin@EXAMPLE.COM');