Google app engine database

G

glenn.a.isaac

Is there a way to make sure that whenever you're making google engine app iterations to a database that that info does not get wiped/deleted. Please advise
 
M

Mark Lawrence

Is there a way to make sure that whenever you're making google engine app iterations to a database that that info does not get wiped/deleted. Please advise

What Python code have you tried or are you contemplating using?
 
K

Kev Dwyer

Is there a way to make sure that whenever you're making google engine app
iterations to a database that that info does not get wiped/deleted.
Please advise

It's not clear what you mean here; I'll guess that by "iterations" you mean
"changes" by "database" you mean the db or ndb datastore and by "info" you
mean "data stored in the datastore". Apologies if this isn't so.

Appengine doesn't document any migration utilities to handle changes in your
datastore schema, so you need to manage the effects of such changes
yourself.

To ensure that you do not lose data when changing your model code, avoid
making destructive changes to your models, i.e.

- don't delete properties from a model
- don't rename properties on a model

If you must make these changes for some reason, you'll need to migrate the
data somehow.

In my experience with Appengine, data is not actaully lost if you make
destructive changes to your models, it becomes inaccessible becuae the
property names it was stored under no longer exist on the model. In theory
you could access the data by adding the proprties back to the model or
(maybe) by loading a different model definition in the remote shell, but
this is not something that you would want to rely on in a production
environment.

tl,dr: it's ok to add new properties to you models, but don't remove or
rename properties.

Hope that helps,

Kev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,078
Messages
2,570,570
Members
47,204
Latest member
MalorieSte

Latest Threads

Top