Closed dansan closed 4 years ago
./manage.py migarate_metadata_field
has run on the server, all Map
objects now have both metadata
and metadata2
filled.
Map.metadata2
is a TextField
that contains a JSON dump of a maps properties (gravity, height, wind etc.).
Map.metadata
is now deprecated and can be removed.
OK, confirmed with:
In [16]: for map_ in Map.objects.all():
...: if not map_.metadata:
...: assert not map_.metadata2
...: continue
...: assert map_.metadata["metadata"]["MapFileName"] == map_.metadata2["metadata"]["MapFileName"]
...: assert map_.metadata["metadata"]["Gravity"] == map_.metadata2["metadata"]["Gravity"]
...: assert map_.metadata["filename"] == map_.metadata2["filename"]
(Yes - the metadata
attribute has a metadata
key… don't ask…)
Migrations ran and removed the field Map.metadata
(v1).
The server was restarted.
The data in
Map.metadata
is stored in aPickledObjectField
. In Django 3 with Python 3 and django-picklefield updated from0.3.2
to2.0
it cannot be loaded anymore.