Skip to content

Commit

Permalink
ZDU finalize Collection Version sha256
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Apr 26, 2024
1 parent d2949b2 commit e96ba80
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 58 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 3.2.14 on 2022-07-21 23:05

from django.db import migrations, models
from pulpcore.plugin.migrations import RequireVersion


class Migration(migrations.Migration):

dependencies = [
('ansible', '0057_collectionversion_sha256_migrate'),
('core', '0110_apiappstatus'),
]

operations = [
# TODO adjust this version!!!
RequireVersion("ansible", "0.22.0"),
migrations.AlterField(
model_name='collectionversion',
name='sha256',
field=models.CharField(db_index=True, max_length=64, null=False),
),
migrations.AlterUniqueTogether(
name='collectionversion',
unique_together={('sha256',)},
),
]
4 changes: 2 additions & 2 deletions pulp_ansible/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class CollectionVersion(Content):
namespace = models.CharField(max_length=64, editable=False)
repository = models.CharField(default="", blank=True, max_length=2000, editable=False)
requires_ansible = models.CharField(null=True, max_length=255)
sha256 = models.CharField(max_length=64, null=True, blank=False)
sha256 = models.CharField(max_length=64, db_index=True, null=False, blank=False)

version = models.CharField(max_length=128, db_collation="pulp_ansible_semver")
version_major = models.IntegerField()
Expand Down Expand Up @@ -229,7 +229,7 @@ def __str__(self):

class Meta:
default_related_name = "%(app_label)s_%(model_name)s"
unique_together = (("namespace", "name", "version"), ("sha256",))
unique_together = ("sha256",)
constraints = [
UniqueConstraint(
fields=("collection", "is_highest"),
Expand Down

0 comments on commit e96ba80

Please sign in to comment.