adding exception catch for debugging
@@ -16,6 +16,7 @@ def migrate_relation_meta(apps, schema_editor):
Relation = apps.get_model("hs_core", "Relation")
Source = apps.get_model("hs_core", "Source")
transaction.set_autocommit(False)
+ try:
for res in BaseResource.objects.all().iterator():
res = res.get_content_model()
type_migrated = False
@@ -99,6 +100,10 @@ def migrate_relation_meta(apps, schema_editor):
log.info(log_msg)
print(log_msg)
transaction.commit()
+ except Exception as err:
+ err_msg = "Custom migration of relation metadata failed. Error:{}".format(str(err))
+ print(err_msg)
+ log.error(err_msg)
class Migration(migrations.Migration):
