# Generated by Django 2.2 on 2019-08-20 14:10

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import mds.models
import uuid


class Migration(migrations.Migration):
    deploy_phase = "pre_deploy"

    dependencies = [("mds", "0042_revert_0039_event_type")]

    operations = [
        migrations.CreateModel(
            name="Policy",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4, primary_key=True, serialize=False
                    ),
                ),
                ("name", mds.models.UnboundedCharField()),
                ("description", mds.models.UnboundedCharField(blank=True, default="")),
                ("start_date", models.DateTimeField()),
                ("end_date", models.DateTimeField(blank=True, null=True)),
                ("published_date", models.DateTimeField(blank=True, null=True)),
                ("rules", django.contrib.postgres.fields.jsonb.JSONField(default=list)),
                (
                    "prev_policies",
                    models.ManyToManyField(
                        related_name="_policy_prev_policies_+", to="mds.Policy"
                    ),
                ),
                ("providers", models.ManyToManyField(to="mds.Provider")),
            ],
        )
    ]
