diff --git a/pulp_gem/app/migrations/0001_initial.py b/pulp_gem/app/migrations/0001_initial.py index 1552d2c6..ec3205fd 100644 --- a/pulp_gem/app/migrations/0001_initial.py +++ b/pulp_gem/app/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.5 on 2019-09-19 15:56 +# Generated by Django 4.2.16 on 2024-12-05 16:05 from django.db import migrations, models import django.db.models.deletion @@ -9,14 +9,14 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('core', '0005_progressreport_code'), + ('core', '0091_systemid'), ] operations = [ migrations.CreateModel( name='GemPublication', fields=[ - ('publication_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gempublication', serialize=False, to='core.Publication')), + ('publication_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gempublication', serialize=False, to='core.publication')), ], options={ 'default_related_name': '%(app_label)s_%(model_name)s', @@ -26,7 +26,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='GemRemote', fields=[ - ('remote_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gemremote', serialize=False, to='core.Remote')), + ('remote_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gemremote', serialize=False, to='core.remote')), ], options={ 'default_related_name': '%(app_label)s_%(model_name)s', @@ -36,8 +36,8 @@ class Migration(migrations.Migration): migrations.CreateModel( name='GemDistribution', fields=[ - ('basedistribution_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gemdistribution', serialize=False, to='core.BaseDistribution')), - ('publication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='gem_gemdistribution', to='core.Publication')), + ('basedistribution_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gemdistribution', serialize=False, to='core.basedistribution')), + ('publication', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='gem_gemdistribution', to='core.publication')), ], options={ 'default_related_name': '%(app_label)s_%(model_name)s', @@ -47,7 +47,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='GemContent', fields=[ - ('content_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gemcontent', serialize=False, to='core.Content')), + ('content_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gemcontent', serialize=False, to='core.content')), ('name', models.TextField()), ('version', models.TextField()), ], diff --git a/pulp_gem/app/migrations/0002_gemrepository.py b/pulp_gem/app/migrations/0002_gemrepository.py index 85b79533..96fd4c53 100644 --- a/pulp_gem/app/migrations/0002_gemrepository.py +++ b/pulp_gem/app/migrations/0002_gemrepository.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.13 on 2020-06-28 02:22 +# Generated by Django 4.2.16 on 2024-12-05 16:05 from django.db import migrations, models import django.db.models.deletion @@ -7,7 +7,6 @@ class Migration(migrations.Migration): dependencies = [ - ('core', '0033_increase_remote_artifact_size_field'), ('gem', '0001_initial'), ] @@ -15,7 +14,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='GemRepository', fields=[ - ('repository_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gemrepository', serialize=False, to='core.Repository')), + ('repository_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='gem_gemrepository', serialize=False, to='core.repository')), ], options={ 'default_related_name': '%(app_label)s_%(model_name)s', diff --git a/pulp_gem/app/migrations/0003_move_data_to_new_master_distribution_model.py b/pulp_gem/app/migrations/0003_move_data_to_new_master_distribution_model.py index 59b00025..0d00d9f8 100644 --- a/pulp_gem/app/migrations/0003_move_data_to_new_master_distribution_model.py +++ b/pulp_gem/app/migrations/0003_move_data_to_new_master_distribution_model.py @@ -6,8 +6,8 @@ def migrate_data_from_old_master_model_to_new_master_model(apps, schema_editor): - GemDistribution = apps.get_model('gem', 'GemDistribution') - CoreDistribution = apps.get_model('core', 'Distribution') + GemDistribution = apps.get_model("gem", "GemDistribution") + CoreDistribution = apps.get_model("core", "Distribution") for old_gem_distribution in GemDistribution.objects.all(): with transaction.atomic(): new_master_model_entry = CoreDistribution( @@ -36,39 +36,48 @@ def delete_remaining_old_master_model_entries(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('core', '0062_add_new_distribution_mastermodel'), - ('gem', '0002_gemrepository'), + ("gem", "0002_gemrepository"), ] operations = [ migrations.AddField( - model_name='GemDistribution', - name='distribution_ptr', - field=models.OneToOneField(auto_created=True, null=True, default=None, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, primary_key=False, - related_name='gem_gemdistribution', serialize=False, - to='core.Distribution'), + model_name="GemDistribution", + name="distribution_ptr", + field=models.OneToOneField( + auto_created=True, + null=True, + default=None, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=False, + related_name="gem_gemdistribution", + serialize=False, + to="core.Distribution", + ), preserve_default=False, ), - migrations.RunPython(migrate_data_from_old_master_model_to_new_master_model), + migrations.RunPython(migrate_data_from_old_master_model_to_new_master_model, elidable=True), migrations.RemoveField( - model_name='GemDistribution', - name='basedistribution_ptr', + model_name="GemDistribution", + name="basedistribution_ptr", ), migrations.AlterField( - model_name='GemDistribution', - name='distribution_ptr', - field=models.OneToOneField(auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, primary_key=True, - related_name='gem_gemdistribution', serialize=False, - to='core.distribution'), + model_name="GemDistribution", + name="distribution_ptr", + field=models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + related_name="gem_gemdistribution", + serialize=False, + to="core.distribution", + ), preserve_default=False, ), migrations.RemoveField( - model_name='GemDistribution', - name='publication', + model_name="GemDistribution", + name="publication", ), - migrations.RunPython(delete_remaining_old_master_model_entries), + migrations.RunPython(delete_remaining_old_master_model_entries, elidable=True), ]