# Generated by Django 3.2.6 on 2021-12-02 12:55

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Connection',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('channel_name', models.CharField(max_length=100, verbose_name='Consumers own channel name')),
                ('online', models.BooleanField(default=True)),
                ('awol', models.BooleanField(default=False)),
                ('first_seen', models.DateTimeField(auto_now_add=True, verbose_name='When the connection was made')),
                ('last_action', models.DateTimeField(auto_now=True, verbose_name='Last action')),
                ('last_query', models.DateTimeField(auto_now_add=True, verbose_name="Last time we sent a message to the consumer to check if it's online.")),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='connections', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('user', 'channel_name')},
            },
        ),
    ]
