# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-09 22:57
from __future__ import unicode_literals

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='ChatMessage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('message', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('content', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='CommentLike',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('on', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialMedia.Comment')),
            ],
        ),
        migrations.CreateModel(
            name='FriendRequest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Friendship',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('location', models.CharField(max_length=100)),
                ('content', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='PostLike',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('friends', models.ManyToManyField(related_name='_profile_friends_+', through='socialMedia.Friendship', to='socialMedia.Profile')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='NewPost',
            fields=[
                ('post_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='socialMedia.Post')),
            ],
            bases=('socialMedia.post',),
        ),
        migrations.CreateModel(
            name='SharedPost',
            fields=[
                ('post_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='socialMedia.Post')),
            ],
            bases=('socialMedia.post',),
        ),
        migrations.AddField(
            model_name='postlike',
            name='on',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialMedia.Post'),
        ),
        migrations.AddField(
            model_name='postlike',
            name='profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='post',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='profilePost', to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='post',
            name='placedOnProfile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='placedPost', to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='friendship',
            name='friend',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='friendSet', to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='friendship',
            name='profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='friendshipCreatorSet', to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='friendrequest',
            name='receiver',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='friendRequestsReceived', to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='friendrequest',
            name='sender',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='friendRequestsSent', to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='commentlike',
            name='profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='comment',
            name='post',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialMedia.Post'),
        ),
        migrations.AddField(
            model_name='comment',
            name='profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='chatmessage',
            name='fromProfile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sentMessages', to='socialMedia.Profile'),
        ),
        migrations.AddField(
            model_name='chatmessage',
            name='toProfile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='receivedMessages', to='socialMedia.Profile'),
        ),
        migrations.CreateModel(
            name='AlbumPost',
            fields=[
                ('newpost_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='socialMedia.NewPost')),
                ('album', models.FileField(upload_to='uploads/%Y/%m/%d/')),
            ],
            bases=('socialMedia.newpost',),
        ),
        migrations.CreateModel(
            name='MapPost',
            fields=[
                ('newpost_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='socialMedia.NewPost')),
                ('lat', models.DecimalField(decimal_places=6, max_digits=9)),
                ('lon', models.DecimalField(decimal_places=6, max_digits=9)),
            ],
            bases=('socialMedia.newpost',),
        ),
        migrations.AddField(
            model_name='sharedpost',
            name='sharedPost',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialMedia.NewPost'),
        ),
        migrations.AlterUniqueTogether(
            name='postlike',
            unique_together=set([('profile', 'on')]),
        ),
        migrations.AlterUniqueTogether(
            name='friendship',
            unique_together=set([('profile', 'friend')]),
        ),
        migrations.AlterUniqueTogether(
            name='friendrequest',
            unique_together=set([('sender', 'receiver')]),
        ),
        migrations.AlterUniqueTogether(
            name='commentlike',
            unique_together=set([('profile', 'on')]),
        ),
    ]
