# Generated by Django 3.2.7 on 2021-09-23 04:13

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='List',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='OtherPlacesUser',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bio', models.CharField(max_length=255)),
                ('profile_pic', models.ImageField(null=True, upload_to='profileimages')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Place',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('description', models.TextField()),
                ('address', models.CharField(blank=True, max_length=50, null=True)),
                ('city', models.CharField(max_length=50)),
                ('state', models.CharField(max_length=50)),
                ('postal_code', models.IntegerField(blank=True, null=True)),
                ('country', models.CharField(max_length=50)),
                ('created', models.DateTimeField()),
                ('opuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.otherplacesuser')),
            ],
        ),
        migrations.CreateModel(
            name='VisitedPlace',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('opuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.otherplacesuser')),
                ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.place')),
            ],
        ),
        migrations.CreateModel(
            name='SavedPlace',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('opuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.otherplacesuser')),
                ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.place')),
            ],
        ),
        migrations.CreateModel(
            name='PlacePhoto',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('photo', models.ImageField(null=True, upload_to='placeimages')),
                ('created', models.DateTimeField()),
                ('opuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.otherplacesuser')),
                ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.place')),
            ],
        ),
        migrations.AddField(
            model_name='place',
            name='savers',
            field=models.ManyToManyField(related_name='saved', through='otherplacesapi.SavedPlace', to='otherplacesapi.OtherPlacesUser'),
        ),
        migrations.AddField(
            model_name='place',
            name='visitors',
            field=models.ManyToManyField(related_name='visited', through='otherplacesapi.VisitedPlace', to='otherplacesapi.OtherPlacesUser'),
        ),
        migrations.CreateModel(
            name='ListPlace',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.list')),
                ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.place')),
            ],
        ),
        migrations.AddField(
            model_name='list',
            name='opuser',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.otherplacesuser'),
        ),
        migrations.CreateModel(
            name='Follow',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('follower', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='follower', to='otherplacesapi.otherplacesuser')),
                ('opuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='opuser', to='otherplacesapi.otherplacesuser')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('created', models.DateTimeField()),
                ('opuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.otherplacesuser')),
                ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='otherplacesapi.place')),
            ],
        ),
    ]
