umap/umap/migrations/0023_alter_datalayer_uuid.py
Alexis Métaireau 7dadb83ff5 feat(sync): Let the clients set layers UUID
This make it possible to synchronize datalayers before their creation on
the server, allowing at the same time to solve issues related to them
not being saved (e.g. duplication of geometries)

We use the DataLayer._referenceVersion to track if a DataLayer has been
saved on the server.

After a save, the _referenceVersion is synched with other peers.

To pass the reference version from the server to the frontend, we have two
options:
- use a header
- populate the `options.version` field

In the case of a GET on a Datalayer, we could not use the `options` scenario
because:
- the value in the file is not up to date (it was the value the client has
 before the save)
- the python cannot change it on the fly, as the file is served by nginx

So we decided to keep using a header. But on the map view, we load all
datalayers metadatas in the map options, so here we cannot use the header
scenario, so in this specific case we had to populate `options._referenceVersion`.

At the same time, we also changed:
- Umap.options.umap_id => Umap.id
- DataLayer.umap_id => Datalayer.id
- fixed the version number returned by DataLayer.version_metadata
2024-11-15 15:22:36 +01:00

19 lines
452 B
Python

# Generated by Django 5.1.2 on 2024-11-15 11:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("umap", "0022_add_team"),
]
operations = [
migrations.AlterField(
model_name="datalayer",
name="uuid",
field=models.UUIDField(
editable=False, primary_key=True, serialize=False, unique=True
),
),
]