03-build-failure.sql 1.2 KB

123456789101112131415161718192021222324252627
  1. -- Copyright Materialize, Inc. and contributors. All rights reserved.
  2. --
  3. -- Use of this software is governed by the Business Source License
  4. -- included in the LICENSE file at the root of this repository.
  5. --
  6. -- As of the Change Date specified in that file, in accordance with
  7. -- the Business Source License, use of this software will be governed
  8. -- by the Apache License, Version 2.0.
  9. CREATE OR REPLACE MATERIALIZED VIEW mv_build_job_failed_on_branch AS
  10. SELECT build_step_key, branch, part
  11. FROM build
  12. JOIN build_job ON build.build_id = build_job.build_id
  13. JOIN build_job_failure ON build_job.build_job_id = build_job_failure.build_job_id;
  14. CREATE OR REPLACE MATERIALIZED VIEW mv_build_job_failed AS
  15. SELECT build_step_key, part
  16. FROM build_job
  17. JOIN build_job_failure ON build_job.build_job_id = build_job_failure.build_job_id;
  18. CREATE DEFAULT INDEX ON mv_build_job_failed_on_branch;
  19. CREATE DEFAULT INDEX ON mv_build_job_failed;
  20. ALTER MATERIALIZED VIEW mv_build_job_failed_on_branch OWNER TO qa;
  21. GRANT SELECT ON TABLE mv_build_job_failed_on_branch TO "hetzner-ci";
  22. ALTER MATERIALIZED VIEW mv_build_job_failed OWNER TO qa;
  23. GRANT SELECT ON TABLE mv_build_job_failed TO "hetzner-ci";