# Generated by Django 5.0.7 on 2024-08-01 05:28

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('accrete', '0002_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Name')),
                ('color', models.CharField(max_length=7, verbose_name='Color')),
                ('tag_group', models.CharField(max_length=255, verbose_name='Group')),
                ('tenant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accrete.tenant')),
            ],
            options={
                'verbose_name': 'Tag',
                'verbose_name_plural': 'Tags',
                'db_table': 'accrete_tag',
                'default_related_name': 'tags',
            },
            bases=(models.Model, accrete.annotation.AnnotationModelMixin),
        ),
        migrations.AddConstraint(
            model_name='tag',
            constraint=models.UniqueConstraint(fields=('tenant', 'name'), name='unique_tag_name_per_tenant'),
        ),
        migrations.AddConstraint(
            model_name='tag',
            constraint=models.UniqueConstraint(fields=('tenant', 'tag_group'), name='unique_tag_group_per_tenant'),
        ),
    ]
