forked from pulp/pulp_gem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a migration to check for pending datarepair
fixes pulp#141
- Loading branch information
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added a migration to tell admins to run certain datarepair commands before upgrading to 0.4. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 4.2.1 on 2023-08-15 12:44 | ||
|
||
from django.db import migrations | ||
from pulpcore.migrations import RequireVersion | ||
|
||
|
||
def check_datarepair(apps, schema_editor): | ||
ShallowGemContent = apps.get_model("gem", "ShallowGemContent") | ||
if ShallowGemContent.objects.exists(): | ||
raise RuntimeError("Before continuing with this upgrade, you need to run the 'datarepair-shallow-gems' command, or remove all remaining broken repository versions.") | ||
|
||
GemContent = apps.get_model("gem", "GemContent") | ||
if GemContent.objects.filter(platform=None).exists(): | ||
raise RuntimeError("Before continuing with this upgrade, you need to run the 'datarepair-gemspec-platform' command, or remove all remaining broken repository versions.") | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("gem", "0008_gemcontent_platform"), | ||
] | ||
|
||
operations = [ | ||
RequireVersion("gem", "0.2.0"), | ||
migrations.RunPython(code=check_datarepair, reverse_code=migrations.RunPython.noop, elidable=True), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pulpcore>=3.28.0,<3.40 | ||
pulpcore>=3.34.0,<3.40 | ||
rubymarshal>=1.2.7,<1.3 |