How do you run patches or migrations on datastore?

61 views
Skip to first unread message

Marwan abdel moneim

unread,
Nov 4, 2017, 7:30:08 AM11/4/17
to google-appengine-go
I am surprised that there is no way not run migrations or patches, there are not even packages written by the community that I can find.

What if I like to change the name of a field for example, or compute and certain value then add it to a field for all entities in certain kind? How do you guys handles this tasks?

Evan Jones

unread,
Nov 4, 2017, 1:43:00 PM11/4/17
to google-appengine-go
We never rename "deployed" fields: it is too painful. We also have both Python and Go, so we use the Python MapReduce library if we ever need to rewrite all datastore objects. Again, this is painful so we try to avoid it. In general, we get a long way with only adding "default" fields, so we don't have to mess with it too much.

I don't disagree that this is all very annoying and there could be better tools around it.

Evan

dcco...@gmail.com

unread,
Nov 4, 2017, 3:06:21 PM11/4/17
to google-appengine-go


On Saturday, November 4, 2017, Evan Jones wrote:
We never rename "deployed" fields: it is too painful. We also have both Python and Go, so we use the Python MapReduce library if we ever need to rewrite all datastore objects. Again, this is painful so we try to avoid it. In general, we get a long way with only adding "default" fields, so we don't have to mess with it too much.

What do you mean by only adding default fields? Could you expand on that?

Evan Jones

unread,
Nov 5, 2017, 9:46:59 AM11/5/17
to dcco...@gmail.com, google-appengine-go
When we add fields to a Go struct that represents an entity that has been in use in production, we make sure that the "default" value for the property is handled appropriately. E.g. if you add a property of type string, the code has to expect values of the empty string for the "old" entities that never set it.


--
You received this message because you are subscribed to a topic in the Google Groups "google-appengine-go" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine-go/rV1ROZH_q5Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengine-go+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine-go/2a3e4523-cf20-47af-9e15-8468ab268a3c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alexander Trakhimenok

unread,
Nov 6, 2017, 6:37:12 AM11/6/17
to google-appengine-go
I use PropertyLoadSaver interface to migrate props lazily and there is an excellent https://github.com/CaptainCodeman/datastore-mapper Go package for AppEngine datastore that implements the “map” part of mapreduce.

Using this 2 together works very well.
Reply all
Reply to author
Forward
0 new messages