From 8fd3ff706da5712d32f4173893a8bc18170b8128 Mon Sep 17 00:00:00 2001 From: Kshitij Sobti Date: Tue, 29 Jun 2021 15:58:33 +0530 Subject: [PATCH] fix: Creates a squashed migration for xblock_config that removes moved model A previous PR moved the CourseEditLTIFieldsEnabledFlag model to the LTI consumer XBlock's repo. The migrations in the XBlock repo check if the model already exists, and if so, it will avoid creating the model. However, it seems that in some cases the LTI consumer XBlock's migrations run first, creating the model and causing the edx-platform migrations to fail due to a pre-existing table since no such check is performed in the migrations in edx-platform. Since the only migrations that exist for this model are one that creates it and another that deletes it, this change creates a squashed miration that just skips creating the model since for new installs the LTI Consumer XBlock should handle it. --- ...elds_enabled_flag_model_to_lti_consumer.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cms/djangoapps/xblock_config/migrations/0001_squashed_0003_move_course_edit_lti_fields_enabled_flag_model_to_lti_consumer.py diff --git a/cms/djangoapps/xblock_config/migrations/0001_squashed_0003_move_course_edit_lti_fields_enabled_flag_model_to_lti_consumer.py b/cms/djangoapps/xblock_config/migrations/0001_squashed_0003_move_course_edit_lti_fields_enabled_flag_model_to_lti_consumer.py new file mode 100644 index 0000000000..0093da42bf --- /dev/null +++ b/cms/djangoapps/xblock_config/migrations/0001_squashed_0003_move_course_edit_lti_fields_enabled_flag_model_to_lti_consumer.py @@ -0,0 +1,34 @@ +# Generated by Django 2.2.24 on 2021-06-29 09:29 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import opaque_keys.edx.django.models + + +class Migration(migrations.Migration): + + replaces = [('xblock_config', '0001_initial'), ('xblock_config', '0002_courseeditltifieldsenabledflag'), ('xblock_config', '0003_move_course_edit_lti_fields_enabled_flag_model_to_lti_consumer')] + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='StudioConfig', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), + ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), + ('disabled_blocks', models.TextField(default='about course_info static_tab', help_text='Space-separated list of XBlocks on which XBlockAsides should never render in studio')), + ('changed_by', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Changed by')), + ], + options={ + 'ordering': ('-change_date',), + 'abstract': False, + }, + ) + ]