Display sequence inconsistencies in database diagnostics page

What does this MR do and why?

This merge request adds sequence ownership disparities to the database diagnostics page (/admin/database_diagnostics).

  1. Backend changes: Add details in schema checker inconsistency object

This is needed to provide richer detail as to what is not right with the database. For example, with sequence ownership we want to display the current owner and the expected owner.

This commit bumps the schema checker version from v1 to v2 accordingly.

  1. Frontend changes: Add frontend support for schema checker subsections

In the database schema monitoring dashboard under the "Sequences", we now have added a subsection that shows incorrect sequence ownership in a table in addition to the missing sequence list.

References

Relates to #396878

Screenshots or screen recordings

image

image

How to set up and validate locally

  1. Check out this branch.
  2. Run gdk restart rails
  3. Run gdk psql
  4. Alter the sequence owner of a random sequence. For example:
ALTER SEQUENCE abuse_report_assignees_id_seq OWNED BY projects.id;
  1. Click on Run Schema Check.
  2. You should then see this discrepancy.
  3. To restore things back:
ALTER SEQUENCE abuse_report_assignees_id_seq OWNED BY abuse_report_assignees.id;

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports

Loading