# Generated by Django 2.1.1 on 2018-09-04 10:37

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Album_Songs',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Albums',
            fields=[
                ('album_id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30)),
                ('release_date', models.DateField()),
                ('album_length', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Artists',
            fields=[
                ('artist_id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30)),
                ('total_songs', models.IntegerField()),
                ('total_albums', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Favorites',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Images',
            fields=[
                ('image_id', models.AutoField(primary_key=True, serialize=False)),
                ('image_location', models.CharField(max_length=30)),
                ('name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Performed_By',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.Albums')),
                ('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.Artists')),
            ],
        ),
        migrations.CreateModel(
            name='Playlists',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('playlist', models.IntegerField()),
                ('name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Songs',
            fields=[
                ('song_id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=30)),
                ('length', models.IntegerField()),
                ('genre', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Sung_By',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.Artists')),
                ('song', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.Songs')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('email_id', models.EmailField(max_length=254, primary_key=True, serialize=False)),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
            ],
        ),
        migrations.AddField(
            model_name='playlists',
            name='song',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.Songs'),
        ),
        migrations.AddField(
            model_name='playlists',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.User'),
        ),
        migrations.AddField(
            model_name='favorites',
            name='song',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.Songs'),
        ),
        migrations.AddField(
            model_name='favorites',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.User'),
        ),
        migrations.AddField(
            model_name='artists',
            name='image_id',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='management.Images'),
        ),
        migrations.AddField(
            model_name='albums',
            name='image',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='management.Images'),
        ),
        migrations.AddField(
            model_name='album_songs',
            name='album',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.Albums'),
        ),
        migrations.AddField(
            model_name='album_songs',
            name='song',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='management.Songs'),
        ),
        migrations.AlterUniqueTogether(
            name='sung_by',
            unique_together={('song', 'artist')},
        ),
        migrations.AlterUniqueTogether(
            name='playlists',
            unique_together={('playlist', 'song', 'user')},
        ),
        migrations.AlterUniqueTogether(
            name='performed_by',
            unique_together={('album', 'artist')},
        ),
        migrations.AlterUniqueTogether(
            name='favorites',
            unique_together={('song', 'user')},
        ),
        migrations.AlterUniqueTogether(
            name='album_songs',
            unique_together={('album', 'song')},
        ),
    ]
