Description
Hielke Hoeve created an issue — 4th November 2008, 2:24:37:
Sometimes when we make an export of our data model using NHibernate's SchemaExport we get a create and drop sql file in which the tables and constraints are ordered in a different way. It is then hard to diff the new files with the old ones and see which column has been added, removed or renamed. I have made a patch which allows for a file in which tables, constraints and the table columns are sorted alphabetically.
The patch does not alter the inner workings of the exporter, it only sorts the tables, columns and constraints when they are written to the sql file. I'm not sure if this will introduce any problems, for example certain key insert statements needing to be in an exact order, but maybe this ordering can be enabled/disabled using a property in Configuration.
Hielke Hoeve added a comment — 4th November 2008, 2:27:29:
Obviously the title should also contain "table".: sorting tables, columns and constraints in schema export
Fabio Maulo added a comment — 8th November 2008, 13:43:43:
mmmmm make that change outside SchemaExport is to dangerous.
BTW the improv is interesting and useful.
Hielke Hoeve added a comment — 8th November 2008, 14:33:28:
We have been using an external sorting machine (doing the same as above) for huge applicatinos for over a year now without problems. Found it a good idea so posted it here, sorry to see that your think it is not a good idea for in nhiberate. Can provide a part of the code as example if needed.
Fabio Maulo added a comment — 10th November 2008, 9:52:42:
where you had read that somebody said that "it is not a good idea" ?
What I said is clear: "the improv is interesting and useful"
Hielke Hoeve added a comment — 10th November 2008, 11:06:27:
I said "sorry to see that your think it is not a good idea for in nhiberate", with that I meant for inside nhibernate.
(Since you said it was too dangerous to make the change inside SchemaExport)
Tuna Toksoz added a comment — 4th February 2009, 13:21:04:
Why is it too dangerous to make it in Configuration?