Skip to content

db: Backfill existing event attachments in a migration - #15801

Merged
jan-auer merged 2 commits into
masterfrom
db/backfill-event-attachment-group-ids
Nov 27, 2019
Merged

jan-auer merged 2 commits into
masterfrom
db/backfill-event-attachment-group-ids

Conversation

@jan-auer

Copy link
Copy Markdown
Member

Backfills event attachments with their group id for more efficient access.

Follow-up to #15798

@jan-auer

Copy link
Copy Markdown
Member Author

@tonyo tonyo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you figure out a way to make

from sentry.utils.query import RangeQuerySetWrapper


def forwards(apps, schema_editor):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you figure out a way to make this importable, so we can easily run this offline?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Does the new function work for you or do you need it moved somewhere outside the migration?

@jan-auer jan-auer Nov 26, 2019 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

from sentry.models import EventAttachment

sentry = __import__("sentry.migrations.0020_auto_20191125_1420")
backfill = getattr(sentry.migrations, '0020_auto_20191125_1420').backfill_group_ids

backfill(EventAttachment)

@jan-auer
jan-auer force-pushed the db/backfill-event-attachment-group-ids branch from 5be052b to ad151e6 Compare November 27, 2019 08:56
@jan-auer
jan-auer merged commit cdee3e6 into master Nov 27, 2019
@jan-auer
jan-auer deleted the db/backfill-event-attachment-group-ids branch November 27, 2019 10:02
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants