123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- # 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):
- 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),
- ),
- ]
|