Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66931

Re: Google app engine database

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.049
X-Spam-Evidence '*H*': 0.90; '*S*': 0.00; 'reason,': 0.07; 'rename': 0.07; 'migration': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'stored': 0.12; 'changes': 0.15; 'appengine': 0.16; 'inaccessible': 0.16; 'models,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'somehow.': 0.16; 'so.': 0.16; 'wrote:': 0.18; 'app': 0.19; 'code,': 0.22; 'header:User-Agent:1': 0.23; 'header:X-Complaints- To:1': 0.27; 'properties': 0.29; "doesn't": 0.30; 'loading': 0.31; 'yourself.': 0.31; 'becomes': 0.33; 'guess': 0.33; 'could': 0.34; 'info': 0.35; 'something': 0.35; 'definition': 0.35; 'but': 0.35; 'google': 0.35; 'add': 0.35; 'there': 0.35; 'i.e.': 0.36; "i'll": 0.36; 'changing': 0.37; 'clear': 0.37; 'remote': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'environment.': 0.39; 'delete': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'ensure': 0.60; 'remove': 0.60; 'hope': 0.61; 'lost': 0.61; 'new': 0.61; "you're": 0.61; 'back': 0.62; "you'll": 0.62; 'making': 0.63; 'email addr:gmail.com': 0.63; 'such': 0.63; 'different': 0.65; 'header:Reply-To:1': 0.67; 'production': 0.68; 'lose': 0.68; 'reply-to:no real name:2**0': 0.71; 'reply-to:addr:gmail.com': 0.80; 'destructive': 0.84; 'shell,': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Kev Dwyer <kevin.p.dwyer@gmail.com>
Subject Re: Google app engine database
Date Sun, 23 Feb 2014 09:56:55 +0000
References <b4502425-ecf6-4151-b19a-a06f459c8fd0@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host cpc5-hari13-2-0-cust222.20-2.cable.virginm.net
Mail-Copies-To kevin.p.dwyer@gmail.com
User-Agent KNode/4.7.2
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To kevin.p.dwyer@gmail.com
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7284.1393149430.18130.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1393149430 news.xs4all.nl 2874 [2001:888:2000:d::a6]:49048
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66931

Show key headers only | View raw


glenn.a.isaac@gmail.com wrote:

> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Google app engine database glenn.a.isaac@gmail.com - 2014-02-22 16:39 -0800
  Re: Google app engine database Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-23 00:57 +0000
  Re: Google app engine database Kev Dwyer <kevin.p.dwyer@gmail.com> - 2014-02-23 09:56 +0000

csiph-web