Skip to content
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

migration(crons): Add dangerous migration to add index for monitor en… #52562

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

rjo100
Copy link
Contributor

@rjo100 rjo100 commented Jul 10, 2023

…vironment on check-ins

Work in preparation for #51877. Will cut a ticket to run the dangerous migration with OPS

@rjo100 rjo100 requested a review from a team as a code owner July 10, 2023 19:45
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 10, 2023
@github-actions
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/0508_index_checkin_monitorenvironment.py ()

--
-- Create index sentry_moni_monitor_1fb26c_idx on field(s) monitor_environment, date_added, status of model monitorcheckin
--
CREATE INDEX CONCURRENTLY "sentry_moni_monitor_1fb26c_idx" ON "sentry_monitorcheckin" ("monitor_environment_id", "date_added", "status");

Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema changes look good to me.

# - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
# have ops run this and not block the deploy. Note that while adding an index is a schema
# change, it's completely safe to run the operation after the code has deployed.
is_dangerous = True
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safety check

@rjo100 rjo100 merged commit a022d17 into master Jul 10, 2023
54 checks passed
@rjo100 rjo100 deleted the rjo100/index-checkin-monitorenv branch July 10, 2023 20:19
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants