|
| 1 | +# Generated by Django 2.2.28 on 2023-02-27 10:53 |
| 2 | + |
| 3 | +import django.db.models.deletion |
| 4 | +import django.utils.timezone |
| 5 | +from django.db import migrations, models |
| 6 | + |
| 7 | +import sentry.db.models.fields.bounded |
| 8 | +import sentry.db.models.fields.foreignkey |
| 9 | +from sentry.new_migrations.migrations import CheckedMigration |
| 10 | + |
| 11 | + |
| 12 | +class Migration(CheckedMigration): |
| 13 | + # This flag is used to mark that a migration shouldn't be automatically run in production. For |
| 14 | + # the most part, this should only be used for operations where it's safe to run the migration |
| 15 | + # after your code has deployed. So this should not be used for most operations that alter the |
| 16 | + # schema of a table. |
| 17 | + # Here are some things that make sense to mark as dangerous: |
| 18 | + # - Large data migrations. Typically we want these to be run manually by ops so that they can |
| 19 | + # be 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 | + # have ops run this and not block the deploy. Note that while adding an index is a schema |
| 22 | + # change, it's completely safe to run the operation after the code has deployed. |
| 23 | + is_dangerous = False |
| 24 | + |
| 25 | + dependencies = [ |
| 26 | + ("sentry", "0362_break_project_integration_fk"), |
| 27 | + ] |
| 28 | + |
| 29 | + operations = [ |
| 30 | + migrations.CreateModel( |
| 31 | + name="ArtifactBundle", |
| 32 | + fields=[ |
| 33 | + ( |
| 34 | + "id", |
| 35 | + sentry.db.models.fields.bounded.BoundedBigAutoField( |
| 36 | + primary_key=True, serialize=False |
| 37 | + ), |
| 38 | + ), |
| 39 | + ( |
| 40 | + "organization_id", |
| 41 | + sentry.db.models.fields.bounded.BoundedBigIntegerField(db_index=True), |
| 42 | + ), |
| 43 | + ("bundle_id", models.UUIDField(null=True)), |
| 44 | + ("artifact_count", sentry.db.models.fields.bounded.BoundedPositiveIntegerField()), |
| 45 | + ("date_added", models.DateTimeField(default=django.utils.timezone.now)), |
| 46 | + ( |
| 47 | + "file", |
| 48 | + sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 49 | + on_delete=django.db.models.deletion.CASCADE, to="sentry.File" |
| 50 | + ), |
| 51 | + ), |
| 52 | + ], |
| 53 | + options={ |
| 54 | + "db_table": "sentry_artifactbundle", |
| 55 | + "unique_together": {("organization_id", "bundle_id")}, |
| 56 | + }, |
| 57 | + ), |
| 58 | + migrations.CreateModel( |
| 59 | + name="ReleaseArtifactBundle", |
| 60 | + fields=[ |
| 61 | + ( |
| 62 | + "id", |
| 63 | + sentry.db.models.fields.bounded.BoundedBigAutoField( |
| 64 | + primary_key=True, serialize=False |
| 65 | + ), |
| 66 | + ), |
| 67 | + ( |
| 68 | + "organization_id", |
| 69 | + sentry.db.models.fields.bounded.BoundedBigIntegerField(db_index=True), |
| 70 | + ), |
| 71 | + ("release_name", models.CharField(max_length=250)), |
| 72 | + ("dist_id", sentry.db.models.fields.bounded.BoundedBigIntegerField(null=True)), |
| 73 | + ("date_added", models.DateTimeField(default=django.utils.timezone.now)), |
| 74 | + ( |
| 75 | + "artifact_bundle", |
| 76 | + sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 77 | + on_delete=django.db.models.deletion.CASCADE, to="sentry.ArtifactBundle" |
| 78 | + ), |
| 79 | + ), |
| 80 | + ], |
| 81 | + options={ |
| 82 | + "db_table": "sentry_releaseartifactbundle", |
| 83 | + "unique_together": { |
| 84 | + ("organization_id", "release_name", "dist_id", "artifact_bundle") |
| 85 | + }, |
| 86 | + }, |
| 87 | + ), |
| 88 | + migrations.CreateModel( |
| 89 | + name="ProjectArtifactBundle", |
| 90 | + fields=[ |
| 91 | + ( |
| 92 | + "id", |
| 93 | + sentry.db.models.fields.bounded.BoundedBigAutoField( |
| 94 | + primary_key=True, serialize=False |
| 95 | + ), |
| 96 | + ), |
| 97 | + ( |
| 98 | + "organization_id", |
| 99 | + sentry.db.models.fields.bounded.BoundedBigIntegerField(db_index=True), |
| 100 | + ), |
| 101 | + ( |
| 102 | + "project_id", |
| 103 | + sentry.db.models.fields.bounded.BoundedBigIntegerField(db_index=True), |
| 104 | + ), |
| 105 | + ("date_added", models.DateTimeField(default=django.utils.timezone.now)), |
| 106 | + ( |
| 107 | + "artifact_bundle", |
| 108 | + sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 109 | + on_delete=django.db.models.deletion.CASCADE, to="sentry.ArtifactBundle" |
| 110 | + ), |
| 111 | + ), |
| 112 | + ], |
| 113 | + options={ |
| 114 | + "db_table": "sentry_projectartifactbundle", |
| 115 | + "unique_together": {("project_id", "artifact_bundle")}, |
| 116 | + }, |
| 117 | + ), |
| 118 | + migrations.CreateModel( |
| 119 | + name="DebugIdArtifactBundle", |
| 120 | + fields=[ |
| 121 | + ( |
| 122 | + "id", |
| 123 | + sentry.db.models.fields.bounded.BoundedBigAutoField( |
| 124 | + primary_key=True, serialize=False |
| 125 | + ), |
| 126 | + ), |
| 127 | + ( |
| 128 | + "organization_id", |
| 129 | + sentry.db.models.fields.bounded.BoundedBigIntegerField(db_index=True), |
| 130 | + ), |
| 131 | + ("debug_id", models.UUIDField()), |
| 132 | + ("source_file_type", models.IntegerField()), |
| 133 | + ("date_added", models.DateTimeField(default=django.utils.timezone.now)), |
| 134 | + ("date_last_accessed", models.DateTimeField(default=django.utils.timezone.now)), |
| 135 | + ( |
| 136 | + "artifact_bundle", |
| 137 | + sentry.db.models.fields.foreignkey.FlexibleForeignKey( |
| 138 | + on_delete=django.db.models.deletion.CASCADE, to="sentry.ArtifactBundle" |
| 139 | + ), |
| 140 | + ), |
| 141 | + ], |
| 142 | + options={ |
| 143 | + "db_table": "sentry_debugidartifactbundle", |
| 144 | + "unique_together": {("debug_id", "artifact_bundle", "source_file_type")}, |
| 145 | + }, |
| 146 | + ), |
| 147 | + ] |
0 commit comments