# Generated by Django 5.0.3 on 2024-03-15 14:08 import datetime import django.contrib.postgres.fields.hstore import django.contrib.postgres.search import django.db.models.deletion import uuid from django.db import migrations, models # Functions from the following migrations need manual copying. # Move them and any dependencies into this file, then update the # RunPython operations to refer to the local versions: # apps.performance.migrations.0004_remove_transactionevent_project_and_more # apps.performance.migrations.0008_transactionevent_duration class Migration(migrations.Migration): replaces = [ ("performance", "0001_initial"), ("performance", "0002_auto_20210124_1745"), ("performance", "0003_transactionevent"), ("performance", "0004_remove_transactionevent_project_and_more"), ("performance", "0005_alter_span_data"), ("performance", "0006_rename_title_transactiongroup_transaction_and_more"), ( "performance", "0007_transactionevent_tags_transactiongroup_search_vector_and_more", ), ("performance", "0008_transactionevent_duration"), ("performance", "0009_alter_span_description"), ("performance", "0010_alter_span_id_alter_transactiongroup_id"), ("performance", "0011_alter_transactionevent_duration"), ("performance", "0012_alter_span_op"), ] initial = True dependencies = [ ( "projects", "0001_squashed_0009_alter_project_id_alter_projectcounter_id_and_more", ), ] operations = [ migrations.CreateModel( name="TransactionEvent", fields=[ ( "event_id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("created", models.DateTimeField(auto_now_add=True, db_index=True)), ( "data", models.JSONField(help_text="General event data that is searchable"), ), ( "timestamp", models.DateTimeField( blank=True, help_text="Date created as claimed by client it came from", null=True, ), ), ("transaction", models.CharField(max_length=1024)), ("start_timestamp", models.DateTimeField()), ( "project", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="projects.project", ), ), ], options={ "ordering": ["-created"], }, ), migrations.RemoveField( model_name="transactionevent", name="project", ), migrations.AddField( model_name="transactionevent", name="trace_id", field=models.UUIDField( db_index=True, default="00000000000000000000000000000000" ), preserve_default=False, ), migrations.CreateModel( name="TransactionGroup", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created", models.DateTimeField(auto_now_add=True, db_index=True)), ("transaction", models.CharField(max_length=1024)), ("op", models.CharField(max_length=255)), ("method", models.CharField(blank=True, max_length=255, null=True)), ( "project", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="projects.project", ), ), ( "search_vector", django.contrib.postgres.search.SearchVectorField( editable=False, null=True ), ), ("tags", models.JSONField(default=dict)), ], options={ "unique_together": {("transaction", "project", "op", "method")}, }, ), migrations.AddField( model_name="transactionevent", name="group", field=models.ForeignKey( default=1, on_delete=django.db.models.deletion.CASCADE, to="performance.transactiongroup", ), preserve_default=False, ), migrations.CreateModel( name="Span", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created", models.DateTimeField(auto_now_add=True, db_index=True)), ("span_id", models.CharField(max_length=16)), ( "parent_span_id", models.CharField(blank=True, max_length=16, null=True), ), ("op", models.CharField(max_length=255)), ( "description", models.CharField(blank=True, max_length=1024, null=True), ), ("start_timestamp", models.DateTimeField()), ("timestamp", models.DateTimeField()), ( "tags", django.contrib.postgres.fields.hstore.HStoreField(default=dict), ), ("data", models.JSONField(default=dict)), ( "transaction", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="performance.transactionevent", ), ), ], options={ "abstract": False, }, ), migrations.RemoveField( model_name="transactionevent", name="transaction", ), migrations.AddField( model_name="transactionevent", name="tags", field=django.contrib.postgres.fields.hstore.HStoreField(default=dict), ), migrations.AddField( model_name="transactionevent", name="duration", field=models.DurationField(db_index=True, default=datetime.timedelta(0)), preserve_default=False, ), migrations.AlterField( model_name="span", name="description", field=models.CharField(blank=True, max_length=2000, null=True), ), migrations.AlterField( model_name="span", name="id", field=models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID" ), ), migrations.AlterField( model_name="transactiongroup", name="id", field=models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID" ), ), migrations.RemoveField( model_name="transactionevent", name="duration", ), migrations.AddField( model_name="transactionevent", name="duration", field=models.PositiveIntegerField( db_index=True, default=0, help_text="Milliseconds" ), preserve_default=False, ), migrations.AlterField( model_name="span", name="op", field=models.CharField(blank=True, max_length=255), ), ]