# Generated by Django 4.2.1 on 2023-09-07 18:56

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

import lnschema_core.users


class Migration(migrations.Migration):
    dependencies = [
        ("lnschema_core", "0017_dataset_initial_version_dataset_version"),
    ]

    operations = [
        migrations.RenameModel(
            old_name="DatasetLabel",
            new_name="DatasetULabel",
        ),
        migrations.RenameModel(
            old_name="FileLabel",
            new_name="FileULabel",
        ),
        migrations.RenameModel(
            old_name="Label",
            new_name="ULabel",
        ),
        migrations.RenameField(
            model_name="dataset",
            old_name="labels",
            new_name="ulabels",
        ),
        migrations.RenameField(
            model_name="datasetulabel",
            old_name="label",
            new_name="ulabel",
        ),
        migrations.RenameField(
            model_name="file",
            old_name="labels",
            new_name="ulabels",
        ),
        migrations.RenameField(
            model_name="fileulabel",
            old_name="label",
            new_name="ulabel",
        ),
        migrations.AlterField(
            model_name="ulabel",
            name="created_by",
            field=models.ForeignKey(
                default=lnschema_core.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="created_ulabels",
                to="lnschema_core.user",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="datasetulabel",
            unique_together={("dataset", "ulabel")},
        ),
        migrations.AlterUniqueTogether(
            name="fileulabel",
            unique_together={("file", "ulabel")},
        ),
    ]
