# Generated by Django 3.1.1 on 2021-02-25 13:29

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


class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("resources", "0006_collection_public_access"),
    ]

    operations = [
        migrations.CreateModel(
            name="Tag",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("uid", models.TextField()),
                ("ark", models.TextField(blank=True, null=True)),
                ("label", models.TextField(blank=True, null=True)),
                (
                    "owner",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "étiquette",
                "verbose_name_plural": "étiquettes",
                "unique_together": {("uid", "owner")},
            },
        ),
        migrations.AddField(
            model_name="collection",
            name="tags",
            field=models.ManyToManyField(to="resources.Tag"),
        ),
        migrations.AddField(
            model_name="resource",
            name="tags",
            field=models.ManyToManyField(to="resources.Tag"),
        ),
    ]
