-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(dashboards): create model for linking dashboard query field to another dashboard #101105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DominikB2014
wants to merge
4
commits into
master
Choose a base branch
from
dominikbuszowiecki/browse-67-update-widgets-field-to-link-to-dashboard
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(dashboards): create model for linking dashboard query field to another dashboard #101105
DominikB2014
wants to merge
4
commits into
master
from
dominikbuszowiecki/browse-67-update-widgets-field-to-link-to-dashboard
+82
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR has a migration; here is the generated SQL for for --
-- Create model DashboardFieldLink
--
CREATE TABLE "sentry_dashboardfieldlink" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "field" text NOT NULL, "date_modified" timestamp with time zone NOT NULL, "dashboard_id" bigint NOT NULL, "dashboard_widget_query_id" bigint NOT NULL);
CREATE UNIQUE INDEX CONCURRENTLY "sentry_dashboardfieldlin_dashboard_widget_query_i_f5747538_uniq" ON "sentry_dashboardfieldlink" ("dashboard_widget_query_id", "field");
ALTER TABLE "sentry_dashboardfieldlink" ADD CONSTRAINT "sentry_dashboardfieldlin_dashboard_widget_query_i_f5747538_uniq" UNIQUE USING INDEX "sentry_dashboardfieldlin_dashboard_widget_query_i_f5747538_uniq";
ALTER TABLE "sentry_dashboardfieldlink" ADD CONSTRAINT "sentry_dashboardfiel_dashboard_id_cb8a2e28_fk_sentry_da" FOREIGN KEY ("dashboard_id") REFERENCES "sentry_dashboard" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_dashboardfieldlink" VALIDATE CONSTRAINT "sentry_dashboardfiel_dashboard_id_cb8a2e28_fk_sentry_da";
ALTER TABLE "sentry_dashboardfieldlink" ADD CONSTRAINT "sentry_dashboardfiel_dashboard_widget_que_121a4274_fk_sentry_da" FOREIGN KEY ("dashboard_widget_query_id") REFERENCES "sentry_dashboardwidgetquery" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_dashboardfieldlink" VALIDATE CONSTRAINT "sentry_dashboardfiel_dashboard_widget_que_121a4274_fk_sentry_da";
CREATE INDEX CONCURRENTLY "sentry_dashboardfieldlink_dashboard_id_cb8a2e28" ON "sentry_dashboardfieldlink" ("dashboard_id");
CREATE INDEX CONCURRENTLY "sentry_dashboardfieldlink_dashboard_widget_query_id_121a4274" ON "sentry_dashboardfieldlink" ("dashboard_widget_query_id"); |
❌ 34 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds another model that will link a dashboard widget query field to another dashboard. It's possible for a dashboard widget query to belong to a non-table, however we'll do some validation on the backend to ensure we don't somehow create dashboard links that originate from non-tables.
Alternatively i was thinking of adding a
links
field to the dashboard widget query model, however we can't do an array of foreign keys as the type, therefore we don't be able to cascade deletions.