# Generated by Django 5.1.1 on 2024-10-28 12:53

import datetime

from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("receipts", "0002_jobstartedreceipt_is_organic"),
    ]

    operations = [
        migrations.CreateModel(
            name="JobAcceptedReceipt",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("job_uuid", models.UUIDField()),
                ("validator_hotkey", models.CharField(max_length=256)),
                ("miner_hotkey", models.CharField(max_length=256)),
                ("validator_signature", models.CharField(max_length=256)),
                ("miner_signature", models.CharField(blank=True, max_length=256, null=True)),
                ("timestamp", models.DateTimeField()),
                ("time_accepted", models.DateTimeField()),
                ("ttl", models.IntegerField()),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.RemoveField(
            model_name="jobstartedreceipt",
            name="time_accepted",
        ),
        migrations.AddField(
            model_name="jobfinishedreceipt",
            name="timestamp",
            field=models.DateTimeField(
                default=datetime.datetime(2020, 1, 1, 0, 0, tzinfo=datetime.UTC)
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="jobstartedreceipt",
            name="timestamp",
            field=models.DateTimeField(
                default=datetime.datetime(2020, 1, 1, 0, 0, tzinfo=datetime.UTC)
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="jobstartedreceipt",
            name="ttl",
            field=models.IntegerField(default=0),
            preserve_default=False,
        ),
        migrations.AddIndex(
            model_name="jobfinishedreceipt",
            index=models.Index(fields=["timestamp"], name="jobfinishedreceipt_ts_idx"),
        ),
        migrations.AddIndex(
            model_name="jobstartedreceipt",
            index=models.Index(fields=["timestamp"], name="jobstartedreceipt_ts_idx"),
        ),
        migrations.AddIndex(
            model_name="jobacceptedreceipt",
            index=models.Index(fields=["timestamp"], name="jobacceptedreceipt_ts_idx"),
        ),
        migrations.AddConstraint(
            model_name="jobacceptedreceipt",
            constraint=models.UniqueConstraint(
                fields=("job_uuid",), name="receipts_unique_jobacceptedreceipt_job_uuid"
            ),
        ),
    ]
