diff --git a/osf/migrations/0017_cedarmetadatatemplate.py b/osf/migrations/0017_cedarmetadatatemplate.py index 0c266340c05..57d2a65f3b5 100644 --- a/osf/migrations/0017_cedarmetadatatemplate.py +++ b/osf/migrations/0017_cedarmetadatatemplate.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.17 on 2023-11-13 18:01 +# Generated by Django 3.2.17 on 2023-12-08 17:06 from django.db import migrations, models import django_extensions.db.fields @@ -20,13 +20,14 @@ class Migration(migrations.Migration): ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')), ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')), ('_id', models.CharField(db_index=True, default=osf.models.base.generate_object_id, max_length=24, unique=True)), - ('title', models.CharField(max_length=255)), + ('schema_name', models.CharField(default=None, max_length=255)), + ('cedar_id', models.CharField(default=None, max_length=255)), ('template', osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONField(default=dict, encoder=osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONEncoder)), ('active', models.BooleanField(default=True)), ('template_version', models.PositiveIntegerField()), ], options={ - 'unique_together': {('title', 'template_version')}, + 'unique_together': {('cedar_id', 'template_version')}, }, bases=(models.Model, osf.models.base.QuerySetExplainMixin), ), diff --git a/osf/migrations/0018_auto_20231129_1429.py b/osf/migrations/0018_auto_20231129_1429.py deleted file mode 100644 index 2ab2382e03e..00000000000 --- a/osf/migrations/0018_auto_20231129_1429.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.2.17 on 2023-11-29 14:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('osf', '0017_cedarmetadatatemplate'), - ] - - operations = [ - migrations.AddField( - model_name='cedarmetadatatemplate', - name='cedar_id', - field=models.CharField(default=None, max_length=255), - ), - migrations.AlterField( - model_name='cedarmetadatatemplate', - name='title', - field=models.CharField(default=None, max_length=255), - ), - migrations.AlterUniqueTogether( - name='cedarmetadatatemplate', - unique_together={('cedar_id', 'template_version')}, - ), - ] diff --git a/osf/models/cedar_metadata.py b/osf/models/cedar_metadata.py index 41e8c9487ac..65b0a8a7981 100644 --- a/osf/models/cedar_metadata.py +++ b/osf/models/cedar_metadata.py @@ -1,10 +1,11 @@ from django.db import models + +from osf.models.base import BaseModel, ObjectIDMixin from osf.utils.datetime_aware_jsonfield import DateTimeAwareJSONField -from .base import BaseModel, ObjectIDMixin class CedarMetadataTemplate(ObjectIDMixin, BaseModel): - title = models.CharField(max_length=255, default=None) + schema_name = models.CharField(max_length=255, default=None) cedar_id = models.CharField(max_length=255, default=None) template = DateTimeAwareJSONField(default=dict) active = models.BooleanField(default=True) @@ -14,4 +15,4 @@ class Meta: unique_together = ('cedar_id', 'template_version') def __unicode__(self): - return f'({self.title}, version {self.tempate_version})' + return f'(name=[{self.schema_name}], version=[{self.template_version}], id=[{self.cedar_id}])'