diff --git a/umap/migrations/0018_datalayer_uuid.py b/umap/migrations/0018_datalayer_uuid.py index 9d0bbd23..6153b1e9 100644 --- a/umap/migrations/0018_datalayer_uuid.py +++ b/umap/migrations/0018_datalayer_uuid.py @@ -25,7 +25,9 @@ class Migration(migrations.Migration): field=models.UUIDField(default=uuid.uuid4, editable=False, null=True), ), migrations.RunPython(gen_uuid, reverse_code=migrations.RunPython.noop), - migrations.AlterField("datalayer", name="id", field=models.CharField(max_length=100, null=True)), + migrations.RunSQL("ALTER TABLE umap_datalayer DROP CONSTRAINT umap_datalayer_pkey"), + # migrations.RemoveConstraint("datalayer", "id"), + migrations.AlterField("datalayer", name="id", field=models.IntegerField(null=True, blank=True)), migrations.AlterField( model_name="datalayer", name="uuid", diff --git a/umap/models.py b/umap/models.py index 780aeb75..0a2fce84 100644 --- a/umap/models.py +++ b/umap/models.py @@ -375,6 +375,7 @@ class DataLayer(NamedModel): (OWNER, _("Owner only")), ) uuid = models.UUIDField(unique=True, primary_key=True, default=uuid.uuid4, editable=False) + id = models.IntegerField(null=True, blank=True) map = models.ForeignKey(Map, on_delete=models.CASCADE) description = models.TextField(blank=True, null=True, verbose_name=_("description")) geojson = models.FileField(upload_to=upload_to, blank=True, null=True)