Files
openobserve/src
Patrick SullivanandSubhradeep Chakraborty edf8b7b069 feat: Migrate reports from meta into reports table (#5946)
Migrates reports out of the `meta` table into new `reports` and
`report_dashboards` tables.
- Creates a new `reports` table
- Creates a new `report_dashboards` junction/join table that establishes
a many-to-many relation between reports and dashboards.
- Transforms data from the `meta` table into the new tables
- Creates a new `"default"` report folder for any organization that has
a report.
- Creates a new `reports` record for each report in the `meta` table.
- Creates a new `report_dashboards` record to link each report to each
of the dashboards it references.
- Previously, in the `meta` table, reports referenced dashboards by
folder ID and dashboard ID that was stored in JSON. This meant that
moving a dashboard would cause the references to that dashboard in
different reports to break. Since the `report_dashboards` table links
reports and dashboards using foreign keys to their KSUIDs, moving a
dashboard can no longer invalidate this reference.
- When `dashboards` or `reports` records are deleted, those deletions
are cascaded to the `report_dashboards` table.
- Updates the existing reports service layer logic to use the new
`reports` table rather than the `meta` table.
- Adds logic so that when a dashboard is deleted, any report which
referenced it is deleted as well.
- ⚠️ This PR removes the reports cache. I'm not sure if this is actually
something that will be OK or if doing this would create problems.
- Rather than trying to update the existing reports cache logic to work
with the other changes introduced in this PR, I thought that it might be
easier to remove the cache and then add it back later in an updated form
which uses the KSUIDs as cache keys rather than the report names since
eventually we will want to make it possible to have reports with
duplicate names.
- If we do actually need the report cache, I can add it back to this PR
and make the necessary updates so that it continues functioning.

---------

Co-authored-by: Subhradeep Chakraborty <chakrabortysubhradeep556@gmail.com>
2025-06-16 16:25:29 +05:30
..