# Generated by Django 3.1 on 2020-08-19 07:38

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='ChatMember',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('notice', models.IntegerField(default=0, verbose_name='채팅수')),
            ],
        ),
        migrations.CreateModel(
            name='ChatRoom',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('place', models.CharField(max_length=10, verbose_name='채팅방')),
                ('trip_id', models.IntegerField(blank=True, null=True)),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('chat_members', models.ManyToManyField(blank=True, related_name='chatroom', through='accounts.ChatMember', to=settings.AUTH_USER_MODEL)),
                ('chat_users', models.ManyToManyField(blank=True, related_name='chatroom', through='accounts.ChatMember', to='accounts.ChatRoom')),
            ],
        ),
        migrations.CreateModel(
            name='Follow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('place', models.CharField(max_length=10, verbose_name='장소')),
                ('deny', models.BooleanField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('nickname', models.CharField(max_length=15, verbose_name='이름')),
                ('age', models.IntegerField(blank=True, null=True, verbose_name='나이')),
                ('gender', multiselectfield.db.fields.MultiSelectField(choices=[('Female', '여'), ('Male', '남')], max_length=11)),
                ('photo', models.TextField(blank=True)),
                ('location', models.CharField(max_length=50, verbose_name='위치')),
                ('follows', models.ManyToManyField(blank=True, related_name='follow', through='accounts.Follow', to='accounts.Profile')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=300)),
                ('sent_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='message_from', to=settings.AUTH_USER_MODEL)),
                ('chatroom', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='accounts.chatroom')),
            ],
        ),
        migrations.AddField(
            model_name='follow',
            name='follow_from',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='follow_to', to='accounts.profile'),
        ),
        migrations.AddField(
            model_name='follow',
            name='follow_to',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='follow_from', to='accounts.profile'),
        ),
        migrations.AddField(
            model_name='follow',
            name='followers',
            field=models.ManyToManyField(blank=True, related_name='follow', through='accounts.Follow', to='accounts.Follow'),
        ),
        migrations.AddField(
            model_name='chatmember',
            name='chatroom',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chatmember', to='accounts.chatroom'),
        ),
        migrations.AddField(
            model_name='chatmember',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
