# Generated by Django 2.2 on 2020-03-23 08:02
# fmt: off

import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models

from fields_history.base import OBJECT_ID_TYPE_SETTING, init_object_id_field


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='FieldsHistory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', init_object_id_field(getattr(settings, OBJECT_ID_TYPE_SETTING, models.TextField))),
                ('history', django.contrib.postgres.fields.jsonb.JSONField(verbose_name='history')),
                ('changed_at', models.DateTimeField(auto_now_add=True, verbose_name='changed at')),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'get_latest_by': 'changed_at',
            },
        ),
    ]
