# Generated by Django 3.2.3 on 2021-07-05 11:11

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='Tweet',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tweet_text', models.TextField(blank=True, null=True)),
                ('tweet_image', models.ImageField(blank=True, null=True, upload_to='')),
                ('tweet_created', models.DateTimeField(auto_now_add=True)),
                ('tweet_updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['tweet_created'],
            },
        ),
        migrations.CreateModel(
            name='TweetLike',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time_stamp', models.DateTimeField(auto_now_add=True)),
                ('tweet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tweets.tweet')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='tweet',
            name='tweet_likes',
            field=models.ManyToManyField(blank=True, related_name='tweet_like_user', through='tweets.TweetLike', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='tweet',
            name='tweet_parent',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='tweets.tweet'),
        ),
        migrations.AddField(
            model_name='tweet',
            name='tweet_user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tweet', to=settings.AUTH_USER_MODEL),
        ),
    ]
