# Generated by Django 5.1.7 on 2025-05-10 00:32

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


class Migration(migrations.Migration):
    dependencies = [
        ("lamindb", "0093_alter_schemacomponent_unique_together"),
    ]

    operations = [
        migrations.CreateModel(
            name="WriteLogLock",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("locked", models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name="MigrationState",
            fields=[
                ("id", models.SmallAutoField(primary_key=True, serialize=False)),
                ("migration_state_id", models.JSONField()),
            ],
        ),
        migrations.CreateModel(
            name="TableState",
            fields=[
                ("id", models.SmallAutoField(primary_key=True, serialize=False)),
                ("table_name", models.CharField(max_length=255)),
                ("backfilled", models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name="WriteLog",
            fields=[
                ("seqno", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True, editable=False, max_length=18, unique=True
                    ),
                ),
                ("space_uid", models.CharField(max_length=12, null=True)),
                ("created_by_uid", models.CharField(default="00000000", max_length=8)),
                ("branch_code", models.IntegerField(default=1)),
                (
                    "run_uid",
                    models.CharField(default="0000000000000000", max_length=16),
                ),
                ("record_uid", models.JSONField(null=True)),
                ("record_data", models.JSONField(null=True)),
                ("event_type", models.PositiveSmallIntegerField()),
                ("created_at", models.DateTimeField()),
                (
                    "migration_state",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.migrationstate",
                    ),
                ),
                (
                    "table",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.tablestate",
                    ),
                ),
            ],
            options={
                "verbose_name": "Write Log",
                "verbose_name_plural": "Write Logs",
            },
        ),
    ]
