From f869d77f2c400bb56d8d279dcce98e9b468e5f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Thu, 22 Feb 2024 15:08:36 +0100 Subject: [PATCH] chore: update migrations --- umap/migrations/0018_datalayer_uuid.py | 4 +++- umap/models.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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)