1

Closed

Migrations: Can't move history table after 5->6 upgrade

description

After upgrading an existing, migrations-enabled app from 5 to 6, moving the history table via HasDefaultSchema is broken. The issue is that we update the history table by adding the new ContextKey column, rather than re-creating the table from scratch. This means that the ContextKey column appears last in the list of columns, rather than 2nd as is usually the case.

The issue manifests when we attempt to move the history table such as after a change via HasDefaultSchema. We generate an INSERT INTO Foo SELECT * FROM Bar to copy the data from the old history table to the new one. Because we are doing a select * rather than explicitly specifying the columns, we end up attempting to insert the Model column into the ContextKey column of the new table, which throws a SQL data conversion error.
Closed May 28, 2013 at 9:25 PM by maumar
Verified, closing

comments

emilcicos wrote May 22, 2013 at 4:26 PM

This should be working after the fix for #739.