# Generated by Django 3.1.4 on 2020-12-16 04:25

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Album',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=128)),
                ('image_url', models.URLField(max_length=256)),
                ('description', models.CharField(max_length=256)),
                ('description_detail', models.TextField()),
                ('release_date', models.DateTimeField()),
            ],
            options={
                'db_table': 'albums',
            },
        ),
        migrations.CreateModel(
            name='Artist',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
            ],
            options={
                'db_table': 'artists',
            },
        ),
        migrations.CreateModel(
            name='Genre',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
            ],
            options={
                'db_table': 'genres',
            },
        ),
        migrations.CreateModel(
            name='PlayLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=16)),
            ],
            options={
                'db_table': 'playlinks',
            },
        ),
        migrations.CreateModel(
            name='ReleaseType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
            ],
            options={
                'db_table': 'release_types',
            },
        ),
        migrations.CreateModel(
            name='Song',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('writer', models.CharField(max_length=32, null=True)),
            ],
            options={
                'db_table': 'songs',
            },
        ),
        migrations.CreateModel(
            name='AlbumsPlayLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.URLField(max_length=256)),
                ('albums', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='albums.album')),
                ('play_links', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='albums.playlink')),
            ],
            options={
                'db_table': 'albums_playlinks',
            },
        ),
        migrations.AddField(
            model_name='album',
            name='artist',
            field=models.ManyToManyField(db_table='albums_artists', to='albums.Artist'),
        ),
        migrations.AddField(
            model_name='album',
            name='genre',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='albums.genre'),
        ),
        migrations.AddField(
            model_name='album',
            name='play_link',
            field=models.ManyToManyField(blank=True, through='albums.AlbumsPlayLink', to='albums.PlayLink'),
        ),
        migrations.AddField(
            model_name='album',
            name='release_type',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='albums.releasetype'),
        ),
        migrations.AddField(
            model_name='album',
            name='song',
            field=models.ManyToManyField(db_table='albums_songs', to='albums.Song'),
        ),
    ]
