SQL Alchemy or Django are by default based on a relational database. Hence any change to the model requires a migration tool such as sqlalchemy-migrate or South.
Now switching to Google App engine and utilizing the ndb, what will happen if I changed a model? Theoretically a NoSQL database such as Big-Table should not care about evolving schema and hence no migration should be required.
However defining a model such as this one, clearly indicates a schema to validate against.
class ExampleModel(ndb.Model):
example_name = ndb.StringProperty(required=True)
example_description = ndb.TextProperty(required=True)
added_by = ndb.UserProperty()
timestamp = ndb.DateTimeProperty(auto_now_add=True)
So what happens if I added a field? Changed a field or even removed a field?
My assumption is the following:
Adding a field
Deleting a field
Modifying a field name
Is this assumption correct?
You can find many answers to your questions in the documentation :
Google App Engine - Updating Your Model's Schema
However what happens if the field is set as required?
Setting a property as required only means that you have to set the value directly in the constructor, so existing entities are not affected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With