diff options
Diffstat (limited to 'gentoobrowse/datasources/schema.sql')
-rw-r--r-- | gentoobrowse/datasources/schema.sql | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gentoobrowse/datasources/schema.sql b/gentoobrowse/datasources/schema.sql index 83ee5a3..d737ef7 100644 --- a/gentoobrowse/datasources/schema.sql +++ b/gentoobrowse/datasources/schema.sql @@ -311,13 +311,13 @@ COMMENT ON TABLE ebuild_uses IS 'Use flags affecting ebuilds'; CREATE TABLE ebuilds ( ebuildid integer NOT NULL, packageid integer NOT NULL, - repoid integer, version text NOT NULL, versioninst ebuildversion NOT NULL, slot text NOT NULL, license text, firstseen timestamp without time zone NOT NULL, - moddate timestamp without time zone NOT NULL + moddate timestamp without time zone NOT NULL, + repoid integer ); ALTER TABLE ebuilds OWNER TO gentoo; -- Name: TABLE ebuilds; Type: COMMENT; Schema: gentoobrowse; Owner: gentoo @@ -404,7 +404,8 @@ CREATE TABLE package_changelogs ( n smallint NOT NULL, person text, email text, - comment text + comment text, + repoid integer NOT NULL ); ALTER TABLE package_changelogs OWNER TO gentoo; -- Name: package_urls; Type: TABLE; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -583,7 +584,7 @@ ALTER TABLE ONLY files ADD CONSTRAINT pk_files PRIMARY KEY (fileid); -- Name: pk_package_changelogs; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: ALTER TABLE ONLY package_changelogs - ADD CONSTRAINT pk_package_changelogs PRIMARY KEY (packageid, date, n); + ADD CONSTRAINT pk_package_changelogs PRIMARY KEY (packageid, date, n, repoid); ALTER TABLE package_changelogs CLUSTER ON pk_package_changelogs; -- Name: pk_packagebugs; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: ALTER TABLE ONLY package_bugs @@ -684,6 +685,7 @@ CREATE INDEX idx_userpackages_package ON user_packages USING btree (packageid); -- Name: fk_ebuild_pkg; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo ALTER TABLE ONLY ebuilds ADD CONSTRAINT fk_ebuild_pkg FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; +-- Name: fk_ebuild_repo; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo ALTER TABLE ONLY ebuilds ADD CONSTRAINT fk_ebuild_repo FOREIGN KEY (repoid) REFERENCES repos(repoid) ON UPDATE CASCADE ON DELETE CASCADE; -- Name: fk_ebuildarch_file; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo @@ -719,6 +721,9 @@ ALTER TABLE ONLY package_bugs -- Name: fk_packagechangelogs_package; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo ALTER TABLE ONLY package_changelogs ADD CONSTRAINT fk_packagechangelogs_package FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; +-- Name: fk_packagechangelogs_repo; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo +ALTER TABLE ONLY package_changelogs + ADD CONSTRAINT fk_packagechangelogs_repo FOREIGN KEY (repoid) REFERENCES repos(repoid) ON UPDATE CASCADE ON DELETE CASCADE; -- Name: fk_packageurls_package; Type: FK CONSTRAINT; Schema: gentoobrowse; Owner: gentoo ALTER TABLE ONLY package_urls ADD CONSTRAINT fk_packageurls_package FOREIGN KEY (packageid) REFERENCES packages(packageid) ON UPDATE CASCADE ON DELETE CASCADE; |