# Generated by Django 5.2.11 on 2026-03-03 16:11

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


class Migration(migrations.Migration):

    dependencies = [
        ('indicators_lib', '0008_alter_indicator_min_mesh'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='UserFavoriteIndicator',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveIntegerField(default=0)),
                ('indicator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favorite_links', to='indicators_lib.indicator')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favorite_indicator_links', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('user', 'order'),
                'unique_together': {('user', 'indicator')},
            },
        ),
        migrations.AddField(
            model_name='indicator',
            name='favorited_by',
            field=models.ManyToManyField(related_name='favorite_indicators', through='indicators_lib.UserFavoriteIndicator', to=settings.AUTH_USER_MODEL),
        ),
    ]
