> In other words: if I want to reduce the size of my entities, is
> it necessary to migrate the old entities to ones with the new
> definition?
I'm pretty sure that the answer to that is yes.
> If so, is it sufficient to re-put() the entity, or must I
> save under a wholly new key?
I think that it should be sufficient re-put() but decided to test that
hypothesis.
It isn't sufficient in the SDK - the SDK admin console continues to
show values for properties that you've deleted from the model
definition after the re-put(). Yes, I checked to make sure that those
properties didn't have values before the re-put().
I did the get and re-put() in a transaction, namely:
def txn(key):
obj = Model.get(key)
obj.put()
assert db.run_in_transaction(txn, key)
I tried two things to get around this problem. The first was to add
db.delete(obj.key()) right before obj.put(). (You can't do obj.delete
because that trashes the obj.)
The second was to add "obj.old_property = None" right before the
obj.put() (old_property is the name of the property that I deleted
from Model's definition.)
Neither one worked. According to the SDK's datastore viewer, existing
instances of Model continued to have values for old_property after I
updated them with that transaction even with the two changes, together
or separately.
If this is also true of the production datastore, this is a big deal.