123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- # Generated by Django 3.1.5 on 2021-01-17 17:07
- import django.contrib.postgres.fields.hstore
- import django.contrib.postgres.operations
- from django.db import migrations, models
- import django.db.models.deletion
- import uuid
- from issues.migrations.sql.triggers import UPDATE_ISSUE_TRIGGER
- class Migration(migrations.Migration):
- replaces = [
- ("events", "0001_initial"),
- ("events", "0002_auto_20201229_1643"),
- ("events", "0003_auto_20210116_2110"),
- ]
- initial = True
- dependencies = [
- ("issues", "0001_squashed_0010_auto_20210117_1543"),
- ("releases", "0002_auto_20201227_1518"),
- ]
- operations = [
- migrations.SeparateDatabaseAndState(
- state_operations=[
- migrations.CreateModel(
- name="Event",
- fields=[
- (
- "event_id",
- models.UUIDField(
- default=uuid.uuid4,
- editable=False,
- primary_key=True,
- serialize=False,
- ),
- ),
- (
- "timestamp",
- models.DateTimeField(
- blank=True,
- help_text="Date created as claimed by client it came from",
- null=True,
- ),
- ),
- (
- "created",
- models.DateTimeField(auto_now_add=True, db_index=True),
- ),
- ("data", models.JSONField()),
- (
- "issue",
- models.ForeignKey(
- help_text="Sentry calls this a group",
- on_delete=django.db.models.deletion.CASCADE,
- to="issues.issue",
- ),
- ),
- (
- "release",
- models.ForeignKey(
- blank=True,
- null=True,
- on_delete=django.db.models.deletion.SET_NULL,
- to="releases.release",
- ),
- ),
- (
- "tags",
- models.ManyToManyField(blank=True, to="events.EventTag"),
- ),
- ],
- options={"ordering": ["-created"],},
- ),
- migrations.CreateModel(
- name="EventTagKey",
- fields=[
- (
- "id",
- models.AutoField(
- auto_created=True,
- primary_key=True,
- serialize=False,
- verbose_name="ID",
- ),
- ),
- ("key", models.CharField(max_length=255, unique=True)),
- ],
- ),
- migrations.CreateModel(
- name="EventTag",
- fields=[
- (
- "id",
- models.AutoField(
- auto_created=True,
- primary_key=True,
- serialize=False,
- verbose_name="ID",
- ),
- ),
- ("value", models.CharField(max_length=225)),
- (
- "key",
- models.ForeignKey(
- on_delete=django.db.models.deletion.CASCADE,
- to="events.eventtagkey",
- ),
- ),
- ],
- options={"unique_together": {("key", "value")},},
- ),
- ],
- ),
- migrations.RunSQL(
- sql=UPDATE_ISSUE_TRIGGER,
- reverse_sql="DROP TRIGGER IF EXISTS event_issue_update on issues_event; DROP FUNCTION IF EXISTS update_issue;",
- ),
- migrations.AlterField(
- model_name="event",
- name="issue",
- field=models.ForeignKey(
- help_text="Sentry calls this a group",
- null=True,
- on_delete=django.db.models.deletion.CASCADE,
- to="issues.issue",
- ),
- ),
- migrations.RemoveField(model_name="event", name="tags",),
- django.contrib.postgres.operations.HStoreExtension(),
- migrations.AddField(
- model_name="event",
- name="tags",
- field=django.contrib.postgres.fields.hstore.HStoreField(default=dict),
- ),
- migrations.DeleteModel(name="EventTag",),
- migrations.DeleteModel(name="EventTagKey",),
- ]
|