# Generated by Django 5.0.1 on 2024-04-24 11:03

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Subscription',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=32)),
                ('url', models.URLField()),
                ('guild_id', models.CharField(max_length=128)),
                ('creation_datetime', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('extra_notes', models.CharField(blank=True, max_length=250, null=True)),
                ('active', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name': 'subscription',
                'verbose_name_plural': 'subscriptions',
                'get_latest_by': '-creation_datetime',
            },
        ),
        migrations.CreateModel(
            name='SavedGuilds',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('guild_id', models.CharField(max_length=128)),
                ('name', models.CharField(max_length=128)),
                ('icon', models.CharField(max_length=128)),
                ('permissions', models.CharField(max_length=64)),
                ('owner', models.BooleanField(default=False)),
                ('added_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddConstraint(
            model_name='subscription',
            constraint=models.UniqueConstraint(fields=('name', 'guild_id'), name='unique name & server pair'),
        ),
    ]
