|
| 1 | +# Generated by Django 5.2.1 on 2025-10-31 19:01 |
| 2 | + |
| 3 | +import django.db.models.deletion |
| 4 | +from django.db import migrations |
| 5 | + |
| 6 | +import sentry.db.models.fields.foreignkey |
| 7 | +from sentry.new_migrations.migrations import CheckedMigration |
| 8 | +from sentry.new_migrations.monkey.models import SafeDeleteModel |
| 9 | +from sentry.new_migrations.monkey.state import DeletionAction |
| 10 | + |
| 11 | + |
| 12 | +class Migration(CheckedMigration): |
| 13 | + # This flag is used to mark that a migration shouldn't be automatically run in production. |
| 14 | + # This should only be used for operations where it's safe to run the migration after your |
| 15 | + # code has deployed. So this should not be used for most operations that alter the schema |
| 16 | + # of a table. |
| 17 | + # Here are some things that make sense to mark as post deployment: |
| 18 | + # - Large data migrations. Typically we want these to be run manually so that they can be |
| 19 | + # monitored and not block the deploy for a long period of time while they run. |
| 20 | + # - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to |
| 21 | + # run this outside deployments so that we don't block them. Note that while adding an index |
| 22 | + # is a schema change, it's completely safe to run the operation after the code has deployed. |
| 23 | + # Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment |
| 24 | + |
| 25 | + is_post_deployment = False |
| 26 | + |
| 27 | + dependencies = [ |
| 28 | + ("releases", "0001_release_models"), |
| 29 | + ("sentry", "1001_prevent_grouphistory_infinte_recursion"), |
| 30 | + ] |
| 31 | + |
| 32 | + operations = [ |
| 33 | + migrations.AlterField( |
| 34 | + model_name="commit", |
| 35 | + name="author", |
| 36 | + field=sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 37 | + db_constraint=False, |
| 38 | + null=True, |
| 39 | + on_delete=django.db.models.deletion.CASCADE, |
| 40 | + related_name="releasecommit_set", |
| 41 | + to="sentry.commitauthor", |
| 42 | + ), |
| 43 | + ), |
| 44 | + migrations.AlterField( |
| 45 | + model_name="commitfilechange", |
| 46 | + name="commit", |
| 47 | + field=sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 48 | + db_constraint=False, |
| 49 | + on_delete=django.db.models.deletion.CASCADE, |
| 50 | + to="releases.commit", |
| 51 | + ), |
| 52 | + ), |
| 53 | + SafeDeleteModel(name="Commit", deletion_action=DeletionAction.MOVE_TO_PENDING), |
| 54 | + SafeDeleteModel(name="CommitFileChange", deletion_action=DeletionAction.MOVE_TO_PENDING), |
| 55 | + ] |
0 commit comments