Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python orm

This is a newbie theory question - I'm just starting to use Python and looking into Django and orm. Question: If I develop my objects and through additional development modify the base object structures, inheritance, etc. - would Django's ORM solution modify the database automatically OR do I need to perform a conversion (if the app is live)?

So, I start with a basic Phone app Object person: name, address, city, state, zip, phone and I change to Object person: title, name, address, city, state, zip, phone object Object phone: type, phone #

Do I manually convert via the db and change the code OR does the ORM middleware make the change? and if so - how?

like image 585
meade Avatar asked Sep 03 '26 06:09

meade


1 Answers

As of Django 1.02 (and as of the latest run-up to 1.1 in subversion), there is no automatic "schema migration". Your choices are to drop the schema and have Django recreate it (via manage.py syncdb), or alter the schema by hand yourself.

There are some tools on the horizon for Django schema migration. (I'm watching South.)

like image 160
Dave W. Smith Avatar answered Sep 04 '26 19:09

Dave W. Smith