I just ran into a minor problem using the code generator. I had added a bit column to a table in the schema (wsgen) file, and mistakenly assigned it a default value of false. The code generator ran, the code compiled, but of course the upgrade script blew
up when it tried to add the column to the table.
Setting the default value to a valid value (i.e., 0) by itself didn't solve the problem because of the way the upgrade scripts apparently run (i.e., in sequential order). The "fix" couldn't be reached because the earlier script with the incorrect
value blew up first.
I solved the problem by manually editing the generated upgrade script to insert the correct value. Recompiling and running the installer then worked.
Ideally, it would be nice if these kind of changes could be handled, although off the top of my head I think that might be hard to do. Or, better yet, can value-checking logic be included in the default value property setter so that invalid values can't
be entered in the schema file in the first place?
p.s. BTW, do I have to worry about the modification to the generated upgrade script getting overwritten on the next generate? Will I have to keep making manual edit corrections forever?