# Generated by Django 2.2.1 on 2019-06-04 14:37

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import picklefield.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('cities_light', '0008_city_timezone'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Community',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('occupation', models.CharField(max_length=50)),
                ('url', models.CharField(max_length=25, unique=True)),
                ('avatar', models.ImageField(null=True, upload_to='communities/avatars')),
            ],
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('city', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='cities_light.City')),
                ('country', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='cities_light.Country')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, default='Name', max_length=25)),
                ('last_name', models.CharField(blank=True, default='Surname', max_length=25)),
                ('avatar', models.ImageField(null=True, upload_to='profiles/avatars')),
                ('header', models.ImageField(null=True, upload_to='profiles/headers')),
                ('status', models.CharField(default='', max_length=20)),
                ('intro', picklefield.fields.PickledObjectField(editable=False, null=True)),
                ('communities', models.ManyToManyField(related_name='members', to='api.Community')),
                ('followers', models.ManyToManyField(to='api.Profile')),
                ('friends', models.ManyToManyField(related_name='_profile_friends_+', to='api.Profile')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='profiles', to='api.Location')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('likes', models.PositiveIntegerField(default=0)),
                ('reposts', models.PositiveIntegerField(default=0)),
                ('created_time', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='posts', to='api.Profile')),
                ('liked_by', models.ManyToManyField(related_name='liked_posts', to='api.Profile')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('likes', models.PositiveIntegerField(default=0)),
                ('created_time', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='api.Profile')),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='api.Post')),
            ],
        ),
    ]
