# Generated by Django 3.2.5 on 2021-08-04 17:27 import datetime import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ( "organizations_ext", "0001_squashed_0003_alter_organization_id_alter_organization_users_and_more", ), ( "environments", "0001_squashed_0003_alter_environment_id_alter_environmentproject_id", ), ( "projects", "0001_squashed_0009_alter_project_id_alter_projectcounter_id_and_more", ), ] operations = [ migrations.CreateModel( name="Monitor", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created", models.DateTimeField(auto_now_add=True, db_index=True)), ( "monitor_type", models.CharField( choices=[ ("ping", "Ping"), ("get", "GET"), ("post", "POST"), ("ssl", "SSL"), ("heartbeat", "Heartbeat"), ], default="ping", max_length=12, ), ), ("name", models.CharField(max_length=200)), ("url", models.URLField(blank=True)), ("expected_status", models.PositiveSmallIntegerField(default=200)), ("expected_body", models.CharField(blank=True, max_length=2000)), ("ip_address", models.GenericIPAddressField(blank=True, null=True)), ( "interval", models.DurationField(default=datetime.timedelta(seconds=60)), ), ( "environment", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="environments.environment", ), ), ( "organization", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="organizations_ext.organization", ), ), ( "project", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="projects.project", ), ), ], options={ "abstract": False, }, ), migrations.CreateModel( name="MonitorCheck", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created", models.DateTimeField(auto_now_add=True, db_index=True)), ("is_up", models.BooleanField()), ( "start_check", models.DateTimeField( help_text="Time when the start of this check was performed" ), ), ( "reason", models.PositiveSmallIntegerField( blank=True, choices=[ (0, "Unknown"), (1, "Timeout"), (2, "Wrong status code"), (3, "Expected response not found"), (4, "SSL Error"), ], default=0, null=True, ), ), ("response_time", models.DurationField(blank=True, null=True)), ("data", models.JSONField(blank=True, null=True)), ( "monitor", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="checks", to="uptime.monitor", ), ), ], options={ "ordering": ("-created",), }, ), migrations.AddIndex( model_name="monitorcheck", index=models.Index( fields=["start_check", "monitor"], name="uptime_moni_start_c_6434f7_idx" ), ), ]