# Generated by Django 2.0.2 on 2018-03-23 22:29

from django.db import migrations, models


SCORE_TYPE_MAP = {1: 'NO_SCORE', 2: 'FULL', 3: 'PIANO', 4: 'CONDENSED'}
FORWARDS_QUERY = """
                 UPDATE library_piece
                 SET "score_type" = %s
                 WHERE "score_id" = %s
                 """
FORWARDS = [(FORWARDS_QUERY, [v, k]) for k, v in SCORE_TYPE_MAP.items()]
REVERSE_QUERY = """
                UPDATE library_piece
                SET "score_id" = %s
                WHERE "score_type" = %s
                """
REVERSE = [(REVERSE_QUERY, [k, v]) for k, v in SCORE_TYPE_MAP.items()]


class 
(migrations.Migration):

    dependencies = [
        ('library', '0008_auto_20180323_2228'),
    ]

    operations = [
        migrations.AddField(
            model_name='piece',
            name='score_type',
            field=models.CharField(blank=True, choices=[('NO_SCORE', 'No Score'), ('CONDENSED', 'Condensed'), ('PIANO', 'Piano'), ('FULL', 'Full')], max_length=12, null=True, verbose_name='Score Type'),
        ),
        migrations.RunSQL(FORWARDS, REVERSE),
        migrations.RemoveField(
            model_name='piece',
            name='score',
        ),
        migrations.DeleteModel(
            name='ScoreType',
        ),
    ]

Migration