> For one, the database is the only place where the entire schema is maintained. This includes indexes, constraints, relationships, etc.
not at all.
> If I need to go add an index to a production system, that is not captured in the code.
Depends of the ORM. With non-AR ORMs your index is very much captured in the code, as is the rest of the schema.
> More importantly, the database exists without the application.
1. That is not the case of the vast majority of databases and applications out there, which have a 1:1 coupling
2. Using an ORM does not preclude (or prevent) correct designs.
> The application does not exist without the database.
The application can very well be database-independent and run on 5 different (and incompatible) databases. If the sql schema is the canonical truth, you need 5 different schema files to handle all possible deployments of your application. If the ORM types definition is the canonical truth, one is enough and the ORM takes care of the details for each database.
> And once your application grows, the database will surely have additional clients
Baseless assertion.
> It's been proven that you can reliably wrap each row in an object and each column's field with a getter/setter pair.
So?
> Migration generation via diffing schemas? That's a much harder, in fact provably intractable problem!
Generating all migrations is intractable, generating 95% of migrations is not. Or South would not be able to do it.
> There are many ways to get from A to B.
So what?
> If you're going to leave it to a computer to generate either migrations or classes with getters and setters, I'd much prefer the computer do the getters/setters.
And I'd rather ask more of my tools. Different strokes for different folks.