# Generated by Django 1.11.27 on 2020-01-24 19:19

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import sentry.db.models.fields.bounded
import sentry.db.models.fields.foreignkey
import sentry.db.models.fields.jsonfield


class Migration(migrations.Migration):
    # This flag is used to mark that a migration shouldn't be automatically run in
    # production. We set this to True for operations that we think are risky and want
    # someone from ops to run manually and monitor.
    # General advice is that if in doubt, mark your migration as `is_dangerous`.
    # Some things you should always mark as dangerous:
    # - Adding indexes to large tables. These indexes should be created concurrently,
    #   unfortunately we can't run migrations outside of a transaction until Django
    #   1.10. So until then these should be run manually.
    # - Large data migrations. Typically we want these to be run manually by ops so that
    #   they can be monitored. Since data migrations will now hold a transaction open
    #   this is even more important.
    # - Adding columns to highly active tables, even ones that are NULL.
    is_dangerous = False

    dependencies = [("sentry", "0026_delete_event")]

    operations = [
        migrations.CreateModel(
            name="ExportedData",
            fields=[
                (
                    "id",
                    sentry.db.models.fields.bounded.BoundedBigAutoField(
                        primary_key=True, serialize=False
                    ),
                ),
                ("date_added", models.DateTimeField(default=django.utils.timezone.now)),
                ("date_finished", models.DateTimeField(null=True)),
                ("date_expired", models.DateTimeField(null=True)),
                ("storage_url", models.URLField(null=True)),
                (
                    "query_type",
                    sentry.db.models.fields.bounded.BoundedPositiveIntegerField(
                        choices=[(0, "DISCOVER_V1"), (1, "BILLING_REPORT"), (2, "ISSUE_BY_TAG")]
                    ),
                ),
                ("query_info", sentry.db.models.fields.jsonfield.JSONField(default=dict)),
                (
                    "organization",
                    sentry.db.models.fields.foreignkey.FlexibleForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="sentry.Organization"
                    ),
                ),
                (
                    "user",
                    sentry.db.models.fields.foreignkey.FlexibleForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
                    ),
                ),
            ],
            options={"db_table": "sentry_exporteddata"},
        )
    ]
