Generally, I have a question about ORM(s), and the best way for managing enterprise/small applications’ database schema and model (Actually, to keep application model and database schema sync always)
Is this a good way to create database schema from application models or first creating database schema and then, create application model from it? Which one is better?
Note: I see this principle in Django ORM, it has a tool which creates/syncs application database schema from application models.
I usually start with a logical model (i.e. model the problem domain), and go from there.
In the dynamic scripting languages, the practice seems to be to create the classes and then let whatever database migration tool create the schema for you.
In Java/Hibernate, the shops I’ve been on have been too paranoid for that, so we created the DDL independently from the classes. The classes and ORM mappings then refer to an existing schema.