# Generated by Django 6.0.1 on 2026-01-22 03:25

from django.conf import settings
from django.db import migrations, models
from django.utils import timezone


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Tenant',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=140)),
                ('logo', models.URLField(blank=True, null=True)),
                ('slug', models.SlugField(help_text='Identity of the tenant, e.g. <slug>.example.com', unique=True)),
                ('environment', models.CharField(blank=True, default='', max_length=48)),
                ('expires_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(db_index=True, default=timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('owner', models.ForeignKey(null=True, on_delete=models.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'tenant',
                'verbose_name_plural': 'tenants',
                'db_table': 'saas_tenant',
                'ordering': ['created_at'],
                'abstract': False,
                'swappable': 'SAAS_TENANT_MODEL',
            },
        ),
    ]
