# Generated by Django 3.2.13 on 2022-07-25 10:45

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


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('messaging', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('topic', models.CharField(help_text='Topic you are subscribing to.', max_length=128)),
                ('arn', models.CharField(blank=True, editable=False, max_length=255, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('modified', models.DateTimeField(auto_now=True, db_index=True)),
            ],
            options={
                'verbose_name': 'Topic',
                'verbose_name_plural': 'Topics',
            },
        ),
        migrations.AlterField(
            model_name='topiccallback',
            name='arn',
            field=models.CharField(blank=True, editable=False, max_length=255, null=True),
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.JSONField()),
                ('subject', models.CharField(blank=True, max_length=128, null=True)),
                ('object_id', models.PositiveIntegerField(editable=False)),
                ('message_id', models.UUIDField(null=True)),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('content_type', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='sent_messages', to='contenttypes.contenttype')),
                ('topic', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sent_messages', to='messaging.topic')),
            ],
            options={
                'verbose_name': 'SentMessage',
                'verbose_name_plural': 'SentMessages',
            },
        ),
        migrations.AlterField(
            model_name='topiccallback',
            name='topic',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='subscriptions', to='messaging.topic'),
        ),
    ]
