I’m getting myself acquainted with MVC by making a ‘for-fun’ site in django. I’m really liking a lot of the features of the api and python itself. But one thing I really didn’t like was that django encourages you to let it build your database FOR you. I’m well aware of inspectDB and I’m interested in using it.
So my question is this, is there any solid reason that I should choose one method of model/DB generation over another? I feel far more comfortable defining my database in the traditional SQL way (where I have access to combined keys). But I’m concerned using things that aren’t available through the Model api may cause problems for me later on. Such as combined keys, medium_text, etc.
I’m using mysql btw.
If you’re starting a new project, always let Django generate the tables. Django provides mechanisms to use a pre-existing database to support legacy data or situations where you aren’t in direct control of the database structure. This is a nice feature of Django for those who need it, but it creates more work for the developer and breaks many conventions in Django.
You still can, and in fact are encouraged to, add additional indexes and any other database-specific optimizations available to you after the fact.