schotime/NPoco — pull request #98 by VoiceOfWisdom (2014-04-04 22:42:56+00:00)
Title: Schema generation

This is a request for comment, as this is not a completed feature. I have done initial work to port the schema generation code from a personal toy ORM, and have run into what could be a fairly major implementation issue. With the I have implemented schema generation/maintenance all schema is verified, and fixed as soon as an object is accessed. This works fine, until a 'destructive' schema change needs to be made, ie setting a column to be an identity column. In SQL Server it is not possible to change a column to an identity column after the table has been created, the table must be dropped and recreated.

It is feeling like I should have the system throw an exception whenever that scenario, and require the developer to massage the schema. It would be encouraged to never release new code that fails to run against existing schema. The other option is to silently continue which seems to be a very bad option, especially with identity columns.