# Generated by Django 3.1.2 on 2020-12-03 10:26

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Log',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('schemaname', models.TextField(default='public')),
                ('matviewname', models.TextField()),
                ('started_at', models.DateTimeField()),
                ('completed_at', models.DateTimeField(null=True)),
            ],
            options={
                'db_table': 'refresh_matview_log',
            },
        ),
        migrations.CreateModel(
            name='Matview',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('schemaname', models.TextField(default='public')),
                ('matviewname', models.TextField()),
                ('is_disabled', models.BooleanField(default=False)),
                ('is_pending', models.BooleanField(default=False)),
                ('is_running', models.BooleanField(default=False)),
                ('priority', models.IntegerField(default=0)),
                ('repeat_seconds', models.IntegerField(null=True)),
                ('started_at', models.DateTimeField(null=True)),
                ('completed_at', models.DateTimeField(null=True)),
            ],
            options={
                'db_table': 'refresh_matview',
            },
        ),
        migrations.AddIndex(
            model_name='matview',
            index=models.Index(fields=['is_disabled'], name='refresh_mat_is_disa_a39b45_idx'),
        ),
        migrations.AddIndex(
            model_name='matview',
            index=models.Index(fields=['is_pending'], name='refresh_mat_is_pend_737b70_idx'),
        ),
        migrations.AddIndex(
            model_name='matview',
            index=models.Index(fields=['is_running'], name='refresh_mat_is_runn_afe5fe_idx'),
        ),
        migrations.AddIndex(
            model_name='matview',
            index=models.Index(fields=['-priority'], name='refresh_mat_priorit_a2f22f_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='matview',
            unique_together={('schemaname', 'matviewname')},
        ),
        migrations.AddIndex(
            model_name='log',
            index=models.Index(fields=['schemaname', 'matviewname'], name='refresh_mat_scheman_a59a06_idx'),
        ),
        migrations.AddIndex(
            model_name='log',
            index=models.Index(fields=['-completed_at'], name='refresh_mat_complet_0db161_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='log',
            unique_together={('schemaname', 'matviewname')},
        ),
    ]
