# Generated by Django 3.0.7 on 2020-07-07 01:16

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='Col_Url',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_order', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Collection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=20)),
                ('description', models.CharField(blank=True, max_length=300)),
                ('creation_date', models.DateField(auto_now_add=True)),
                ('likes', models.IntegerField(default=0)),
                ('thumbnail', models.URLField(default='https://www.belilelangtebus.com/images/foto_header/blank-thumbnail.jpg')),
            ],
        ),
        migrations.CreateModel(
            name='Url',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.URLField()),
            ],
        ),
        migrations.CreateModel(
            name='Shared_Collection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mars_rover.Collection')),
            ],
        ),
        migrations.AddField(
            model_name='collection',
            name='urls',
            field=models.ManyToManyField(blank=True, related_name='collections', through='mars_rover.Col_Url', to='mars_rover.Url'),
        ),
        migrations.AddField(
            model_name='collection',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='col_url',
            name='collection',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mars_rover.Collection'),
        ),
        migrations.AddField(
            model_name='col_url',
            name='url',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mars_rover.Url'),
        ),
        migrations.AddConstraint(
            model_name='collection',
            constraint=models.UniqueConstraint(fields=('user', 'title'), name='unique_user_collection'),
        ),
    ]
