# Generated by Django 5.0.4 on 2024-09-24 14:05

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='MessageMutator',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=64)),
                ('value', models.CharField(max_length=32)),
            ],
        ),
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id', models.PositiveIntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=128)),
                ('icon_hash', models.CharField(blank=True, max_length=128, null=True)),
                ('active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='UniqueContentRule',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=64)),
                ('value', models.CharField(max_length=32)),
            ],
        ),
        migrations.CreateModel(
            name='MessageStyle',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('is_embed', models.BooleanField(default=True)),
                ('is_hyperlinked', models.BooleanField()),
                ('show_author', models.BooleanField()),
                ('show_timestamp', models.BooleanField()),
                ('show_images', models.BooleanField()),
                ('fetch_images', models.BooleanField()),
                ('description_mutator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='desc_mutated_messagestyle', to='home.messagemutator')),
                ('title_mutator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='title_mutated_messagestyle', to='home.messagemutator')),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.server')),
            ],
        ),
        migrations.CreateModel(
            name='ContentFilter',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=32)),
                ('match', models.CharField(max_length=256)),
                ('matching_algorithm', models.PositiveIntegerField(choices=[(0, 'None'), (1, 'Any: Item contains any of these words (space separated)'), (2, 'All: Item contains all of these words (space separated)'), (3, 'Exact: Item contains this string'), (4, 'Regular expression: Item matches this regex'), (5, 'Fuzzy: Item contains a word similar to this word')])),
                ('is_insensitive', models.BooleanField()),
                ('is_whitelist', models.BooleanField()),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.server')),
            ],
        ),
        migrations.CreateModel(
            name='BotLogicLogs',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('level', models.CharField(max_length=32)),
                ('message', models.CharField(max_length=256)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.server')),
            ],
        ),
        migrations.CreateModel(
            name='Subscription',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=32)),
                ('url', models.URLField()),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('extra_notes', models.CharField(blank=True, default='', max_length=250)),
                ('active', models.BooleanField(default=True)),
                ('filters', models.ManyToManyField(blank=True, to='home.contentfilter')),
                ('message_style', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='home.messagestyle')),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.server')),
                ('unique_rules', models.ManyToManyField(to='home.uniquecontentrule')),
            ],
        ),
        migrations.CreateModel(
            name='Content',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('item_id', models.CharField(max_length=1024)),
                ('item_guid', models.CharField(max_length=1024)),
                ('item_url', models.CharField(max_length=1024)),
                ('item_title', models.CharField(max_length=1024)),
                ('item_content_hash', models.CharField(max_length=1024)),
                ('subscription', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.subscription')),
            ],
        ),
    ]
