There should be a way to create an index for an already existing table
Adding on demand or after in general? Because after in general is possible - you just add the new one and if it doesn't exist it will be created.
Not sure if I get what on-demand/after-in-general means. In my case I have a table that is created elsewhere (and I don't have access to the entity definition), where I just know that a few columns exist and I want and index on those columns.
I can imagine of a few use cases for this like schema migrations.
But, in general, creating and updating DML in different places and with only partial knowledge of of the entity feels wrong.
yep it's true. but that would be the approach being wrong and not the feature it self as you said. I don't see any harm to have it. whether it's properly used or not it's a different matter.