Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deleted versions update Repository.last_version
https://pulp.plan.io/issues/6147 closes #6147
- Loading branch information
Showing
6 changed files
with
101 additions
and
12 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 @@ | ||
Repository.latest_version() considering deleted versions |
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 @@ | ||
Renaming Repository.last_version to Repository.next_version |
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,27 @@ | ||
# Generated by Django 2.2.10 on 2020-02-19 20:40 | ||
|
||
from django.db import migrations, transaction | ||
from django.db.models import F | ||
|
||
|
||
def plus_one(apps, schema_editor): | ||
# re: https://pulp.plan.io/issues/6147 | ||
with transaction.atomic(): | ||
Repository = apps.get_model('core', 'Repository') | ||
Repository.objects.all().update(last_version=F('last_version') + 1) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0021_add_signing_service_foreign_key'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(plus_one), | ||
migrations.RenameField( | ||
model_name='repository', | ||
old_name='last_version', | ||
new_name='next_version', | ||
), | ||
] |
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
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