DatabaseBuilder orders the table columns by name with pk columns first a...

...nd fk columns last.
A couple of points:
1. It is very desirable that the order has to be deterministic across machines, i.e. independent of the culture, so invariant case sensitive seems the right choice.
2. For the order of PK members I think we should try preserve the same order that the key members have in the model. This can help someone looking at the database directly and trying to debug, etc.

For FKs it isn't super clear, we could try to preserve the order defined in the model when they don't overlap overlap.

Re the custom ordering, isn't this just the order in which things get in the scaffolded code? If the user then reorders thing in the scaffolded code I would expect use to use whatever order they specified. Does that work?