I was looking at updating to dotConnect 4.2.96 and EF5. On initializing the database, the attempt to check whether it needs to be migrated fails with a FormatException: "String was not recognized as a valid DateTime."
On closer inspection, the __MigrationHistory table in the databases from contain entries like this:
Code: Select all
sqlite> .schema __MigrationHistory
CREATE TABLE __MigrationHistory (
MigrationId varchar NOT NULL,
CreatedOn datetime NOT NULL,
Model blob NOT NULL,
ProductVersion varchar NOT NULL,
PRIMARY KEY (MigrationId)
);
sqlite> select * from __MigrationHistory order by MigrationId;
201209282136224_InitialCreate|2012-09-28 21:36:22|(binary data)|4.3.1
201210030249482_AutomaticMigration|2012-10-03 02:49:48.48.421|(binary data)|4.3.1
201210101927539_AutomaticMigration|2012-10-10 19:27:54.54.213|(binary data)|4.3.1
If I manually edit the table to remove these duplicate fields, the migration then fails with another error: "SQLite does not support dropping a column."
Creating a fresh database, it seems that EF5 doesn't use the CreatedOn column at all:
Code: Select all
sqlite> .schema __MigrationHistory
CREATE TABLE __MigrationHistory (
MigrationId varchar(255) NOT NULL,
Model blob NOT NULL,
ProductVersion varchar(32) NOT NULL,
PRIMARY KEY (MigrationId)
);
sqlite> select * from __MigrationHistory order by MigrationId;
201210171644347_AutomaticMigration|(binary data)|5.0.0.net40
I would consider a "hack" to programmatically fix up the date columns before running the migration process, but even that isn't enough to make it work.
What can I do?