-
+-- -*- mode: sql; sql-product: postgres; -*-
DROP TABLE bug_status_cache CASCADE;
DROP VIEW bug_package CASCADE;
DROP VIEW binary_versions CASCADE;
-- submitter would ideally be NOT NULL, but there are some ancient bugs which do not have submitters
submitter INT REFERENCES correspondent(id),
submitter_full TEXT NOT NULL DEFAULT '',
- unknown_packages TEXT NOT NULL DEfAULT ''
+ unknown_packages TEXT NOT NULL DEFAULT '',
+ unknown_affects TEXT NOT NULL DEFAULT ''
);
CREATE INDEX bug_idx_owner ON bug(owner);
CREATE INDEX bug_idx_submitter ON bug(submitter);
INSERT INTO column_comments VALUES ('bug','owner','Individual who owns this bug; empty if no one owns it');
INSERT INTO column_comments VALUES ('bug','submitter','Individual who submitted this bug; empty if there is no submitter');
INSERT INTO column_comments VALUES ('bug','unknown_packages','Package name if the package is not known');
+INSERT INTO column_comments VALUES ('bug','unknown_affects','Package name if the affected package is not known');
modified TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL,
asof TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL
);
-CREATE UNIQUE INDEX bug_status_cache_bug_suite_arch_idx ON bug_status_cache(bug,suite,arch);
+CREATE UNIQUE INDEX bug_status_cache_bug_suite_arch_idx ON
+ bug_status_cache(bug,suite,arch);
+CREATE UNIQUE INDEX bug_status_cache_bug_col_suite_col_arch_idx ON
+ bug_status_cache(bug,COALESCE(suite,0),COALESCE(arch,0));
CREATE INDEX bug_status_cache_idx_bug ON bug_status_cache(bug);
CREATE INDEX bug_status_cache_idx_status ON bug_status_cache(status);
CREATE INDEX bug_status_cache_idx_arch ON bug_status_cache(arch);
WHERE bsp.bug=b.id) AS package
) AS package,
b.submitter_full AS originator,
- b.log_modified AS log_modified,
- b.creation AS date,
- b.last_modified AS last_modified,
+ EXTRACT(EPOCH FROM b.log_modified) AS log_modified,
+ EXTRACT(EPOCH FROM b.creation) AS date,
+ EXTRACT(EPOCH FROM b.last_modified) AS last_modified,
b.done_full AS done,
string_agg(bb.blocks::text,' ' ORDER BY bb.blocks) AS blocks,
string_agg(bbb.bug::text,' ' ORDER BY bbb.bug) AS blockedby,