# Generated by Django 5.2.1 on 2025-08-07 16:18

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('accrete', '0009_alter_accessgroup_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Theme',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('color_primary', models.CharField(max_length=7, verbose_name='Primary Color')),
                ('color_success', models.CharField(max_length=7, verbose_name='Success Color')),
                ('color_link', models.CharField(max_length=7, verbose_name='Link Color')),
                ('color_warning', models.CharField(max_length=7, verbose_name='Warning Color')),
                ('color_danger', models.CharField(max_length=7, verbose_name='Danger Color')),
                ('theme_markup', models.TextField(blank=True, null=True, verbose_name='Theme Markup')),
                ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tenant_themes', to='accrete.tenant', verbose_name='Tenant')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user_themes', to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
            options={
                'verbose_name': 'Theme',
                'verbose_name_plural': 'Themes',
                'db_table': 'accrete_theme',
                'ordering': ['pk'],
                'constraints': [models.CheckConstraint(condition=models.Q(('user__isnull', True), ('tenant__isnull', True), _connector='XOR'), name='check_user_or_tenant', violation_error_message='')],
            },
        ),
    ]
