# Generated by Django 4.2.5 on 2023-10-18 07:14
import datetime

from django.db import migrations, models
from django.db.migrations import RunPython


class Migration(migrations.Migration):
    initial = True

    dependencies = [
    ]

    def create_initial_record(apps, schema_editor):
        print("Creating configuration record for migration zero.")
        MigrationZeroConfiguration = apps.get_model("django_migration_zero", "MigrationZeroConfiguration")
        MigrationZeroConfiguration.objects.create(migration_imminent=False, migration_date=datetime.date(1970, 1, 1))

    operations = [
        migrations.CreateModel(
            name='MigrationZeroConfiguration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('migration_imminent', models.BooleanField(default=False,
                                                           help_text='Enable this checkbox to prepare the database for a migration zero reset on the next deployment.',
                                                           verbose_name='Migration imminent')),
                ('migration_date', models.DateField(blank=True, null=True, verbose_name='Migration date')),
            ],
            options={'verbose_name': 'Configuration', 'verbose_name_plural': 'Configurations'},
        ),
        RunPython(create_initial_record),
    ]
