forked from pulp/pulp_ansible
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix constraint violation in is_latest
This bugfix contains a migration and is therefore not backportable. fixes pulp#1571
- Loading branch information
Showing
5 changed files
with
50 additions
and
64 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 @@ | ||
Prevented a race condition that lead to contraint violations when calculating the highest version of a collection. |
27 changes: 27 additions & 0 deletions
27
pulp_ansible/app/migrations/0055_alter_collectionversion_version_alter_role_version.py
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 4.2.4 on 2023-09-15 09:23 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("ansible", "0054_split_collection_version_numbers"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
# Custom roles are only allowed with postgreSQL 16. | ||
sql="CREATE COLLATION pulp_ansible_semver (provider = 'icu', locale = 'en-US-u-kn-true')", | ||
reverse_sql="DROP COLLATION pulp_ansible_semver", | ||
), | ||
migrations.AlterField( | ||
model_name="collectionversion", | ||
name="version", | ||
field=models.CharField(db_collation="pulp_ansible_semver", max_length=128), | ||
), | ||
migrations.AlterField( | ||
model_name="role", | ||
name="version", | ||
field=models.CharField(db_collation="pulp_ansible_semver", max_length=128), | ||
), | ||
] |
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