|
@@ -0,0 +1,63 @@
|
|
|
+# Generated by Django 5.1.1 on 2024-09-28 00:10
|
|
|
+
|
|
|
+import django.db.models.deletion
|
|
|
+from django.db import migrations, models
|
|
|
+
|
|
|
+import sentry.db.models.fields.bounded
|
|
|
+import sentry.db.models.fields.foreignkey
|
|
|
+import sentry.workflow_engine.models.detector_state
|
|
|
+from sentry.new_migrations.migrations import CheckedMigration
|
|
|
+
|
|
|
+
|
|
|
+class Migration(CheckedMigration):
|
|
|
+ # This flag is used to mark that a migration shouldn't be automatically run in production.
|
|
|
+ # This should only be used for operations where it's safe to run the migration after your
|
|
|
+ # code has deployed. So this should not be used for most operations that alter the schema
|
|
|
+ # of a table.
|
|
|
+ # Here are some things that make sense to mark as post deployment:
|
|
|
+ # - Large data migrations. Typically we want these to be run manually so that they can be
|
|
|
+ # monitored and not block the deploy for a long period of time while they run.
|
|
|
+ # - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
|
|
|
+ # run this outside deployments so that we don't block them. Note that while adding an index
|
|
|
+ # is a schema change, it's completely safe to run the operation after the code has deployed.
|
|
|
+ # Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment
|
|
|
+
|
|
|
+ is_post_deployment = False
|
|
|
+
|
|
|
+ dependencies = [
|
|
|
+ ("workflow_engine", "0007_loosen_workflow_action_relationship"),
|
|
|
+ ]
|
|
|
+
|
|
|
+ operations = [
|
|
|
+ migrations.CreateModel(
|
|
|
+ name="DetectorState",
|
|
|
+ fields=[
|
|
|
+ (
|
|
|
+ "id",
|
|
|
+ sentry.db.models.fields.bounded.BoundedBigAutoField(
|
|
|
+ primary_key=True, serialize=False
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ("date_updated", models.DateTimeField(auto_now=True)),
|
|
|
+ ("date_added", models.DateTimeField(auto_now_add=True)),
|
|
|
+ ("detector_group_key", models.CharField(blank=True, max_length=200, null=True)),
|
|
|
+ ("active", models.BooleanField(default=False)),
|
|
|
+ (
|
|
|
+ "state",
|
|
|
+ models.CharField(
|
|
|
+ default=sentry.workflow_engine.models.detector_state.DetectorStatus["OK"],
|
|
|
+ max_length=200,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ (
|
|
|
+ "detector",
|
|
|
+ sentry.db.models.fields.foreignkey.FlexibleForeignKey(
|
|
|
+ on_delete=django.db.models.deletion.CASCADE, to="workflow_engine.detector"
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ "abstract": False,
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ]
|