# Generated by Django 3.1.7 on 2021-07-23 12:07

import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import micro.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='FollowRelationship',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='PublisherModel',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='auth.user')),
                ('bio', models.CharField(blank=True, max_length=250)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='TagModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=15)),
                ('ocurrencies', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='CompanyModel',
            fields=[
                ('publishermodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='micro.publishermodel')),
                ('apiKey', models.CharField(max_length=50, validators=[django.core.validators.MinLengthValidator(50)])),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('micro.publishermodel',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='PublicMessageModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=140)),
                ('date', models.DateField()),
                ('author', models.ForeignKey(on_delete=models.SET(micro.models.get_sentinel_user), related_name='author', to='micro.publishermodel')),
                ('mentions', models.ManyToManyField(blank=True, related_name='mentions', to='micro.PublisherModel')),
                ('tags', models.ManyToManyField(blank=True, to='micro.TagModel')),
            ],
        ),
        migrations.CreateModel(
            name='PrivateMessageModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('text', models.CharField(max_length=250)),
                ('destination', models.ForeignKey(on_delete=models.SET(micro.models.get_sentinel_user), related_name='destination', to='micro.publishermodel')),
                ('source', models.ForeignKey(on_delete=models.SET(micro.models.get_sentinel_user), related_name='source', to='micro.publishermodel')),
            ],
        ),
        migrations.CreateModel(
            name='UserModel',
            fields=[
                ('publishermodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='micro.publishermodel')),
                ('phone', models.CharField(blank=True, max_length=20)),
                ('birthday', models.DateField(blank=True)),
                ('follows', models.ManyToManyField(blank=True, through='micro.FollowRelationship', to='micro.UserModel')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('micro.publishermodel',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='followrelationship',
            name='from_user',
            field=models.ForeignKey(on_delete=models.SET(micro.models.get_sentinel_user), related_name='from_user', to='micro.usermodel'),
        ),
        migrations.AddField(
            model_name='followrelationship',
            name='to_user',
            field=models.ForeignKey(on_delete=models.SET(micro.models.get_sentinel_user), related_name='to_user', to='micro.usermodel'),
        ),
        migrations.AlterUniqueTogether(
            name='followrelationship',
            unique_together={('from_user', 'to_user')},
        ),
    ]
