# Generated by Django 3.0.4 on 2020-04-04 20:37

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='TrilbyUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('remote_url', models.URLField(blank=True, max_length=255, null=True, unique=True)),
                ('remote_username', models.CharField(blank=True, max_length=255, null=True)),
                ('icon_image', models.ImageField(help_text='A small square image used to identify you.', null=True, upload_to='', verbose_name='icon')),
                ('header_image', models.ImageField(help_text="A large image, wider than it's tall, which appears at the top of your profile page.", null=True, upload_to='', verbose_name='header image')),
                ('display_name', models.TextField(help_text='Your name, in human-friendly form. Something like "Alice Liddell".', verbose_name='display name')),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('publicKey', models.TextField(blank=True, null=True, verbose_name='public key')),
                ('privateKey', models.TextField(blank=True, null=True, verbose_name='private key')),
                ('note', models.TextField(default='', help_text='Your biography. Something like "I enjoy falling down rabbitholes."', max_length=255, verbose_name='bio')),
                ('auto_follow', models.BooleanField(default=True, help_text='If True, follow requests will be accepted automatically.')),
                ('locked', models.BooleanField(default=False, help_text="If True, only followers can see this account's statuses.")),
                ('bot', models.BooleanField(default=False, help_text="If True, this account is a bot. If False, it's a human.")),
                ('moved_to', models.URLField(blank=True, default=True, help_text='If set, this account has moved away, and this is where it went.', max_length=255, null=True)),
                ('default_visibility', models.CharField(default='A', max_length=1)),
                ('default_sensitive', models.BooleanField(default=False)),
                ('language', models.CharField(default='en', max_length=255, null=True)),
                ('local_user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Status',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('remote_url', models.URLField(blank=True, max_length=255, null=True, unique=True)),
                ('content', models.TextField()),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('sensitive', models.BooleanField(default=False)),
                ('spoiler_text', models.CharField(blank=True, default='', max_length=255, null=True)),
                ('visibility', models.CharField(default='A', help_text="Visiblity of this status.\n\n            Public (A): visible to anyone.\n            Unlisted (U): visible to anyone, but\n                doesn't appear in timelines.\n            Private (X): only visible to followers.\n            Direct (D): visible to nobody except tagged people.\n\n            Additionally, a person tagged in a status can\n            always view that status.", max_length=1)),
                ('language', models.CharField(default='en', max_length=255, null=True)),
                ('idempotency_key', models.CharField(default=None, max_length=255, null=True)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='trilby_api.Person')),
                ('in_reply_to_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='trilby_api.Status')),
            ],
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('notification_type', models.CharField(choices=[('F', 'follow'), ('M', 'mention'), ('R', 'reblog'), ('L', 'favourite')], max_length=1)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('about_account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='notifications_about', to='trilby_api.Person')),
                ('for_account', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='notifications_for', to='trilby_api.Person')),
                ('status', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='trilby_api.Status')),
            ],
        ),
        migrations.CreateModel(
            name='Like',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('liked', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='trilby_api.Status')),
                ('liker', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='trilby_api.Person')),
            ],
        ),
        migrations.CreateModel(
            name='Follow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('requested', models.BooleanField(default=True)),
                ('show_reblogs', models.BooleanField(default=True)),
                ('follower', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='following', to='trilby_api.Person')),
                ('following', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='followers', to='trilby_api.Person')),
            ],
        ),
        migrations.AddConstraint(
            model_name='like',
            constraint=models.UniqueConstraint(fields=('liker', 'liked'), name='i_cant_like_this_enough'),
        ),
        migrations.AddConstraint(
            model_name='follow',
            constraint=models.UniqueConstraint(fields=('follower', 'following'), name='follow_only_once'),
        ),
    ]
