__MigrationHistory issue

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
m.ende
Posts: 4
Joined: Tue 26 Aug 2014 07:05

__MigrationHistory issue

Post by m.ende » Tue 26 Aug 2014 07:27

Hi,

I'm trying to use autmatic migration on a code first project. But there is an issue with the
__migrationHistory table.

When I'm starting without a database everything works fine and the database seems to be created. But when i try to access this database I'll receive this error:

Code: Select all

SQLite error no such column: c.CreatedOn
When using the DbMonitor I'll find this command which failes:

Code: Select all

SELECT 
c.CreatedOn
FROM __MigrationHistory AS c
LIMIT 1 
And in the database is only a table with this ddl:

Code: Select all

CREATE TABLE __MigrationHistory ( 
  MigrationId varchar(150) NOT NULL,
  ContextKey varchar(300) NOT NULL,
  Model blob NOT NULL,
  ProductVersion varchar(32) NOT NULL,
  PRIMARY KEY (MigrationId, ContextKey)
)
So the error is truely correct. The column is missing.
But when I have a look into a __MigrationHistory on a SQL-Server
there is no such line. It's exactly as the __MigrationHistory in the SQLite Database.

One point to mention: The CreatedOn property is included in an AbstractBaseEntity. Which contains the common information for the entities (PK, ChangedOn, CreatedOn, DeletedOn).
So, what do I have to do?

Thanks for your help.

Marc

m.ende
Posts: 4
Joined: Tue 26 Aug 2014 07:05

Re: __MigrationHistory issue

Post by m.ende » Tue 26 Aug 2014 08:05

Ahh... I've found this link which explains that the missing column isn't an issue:

http://stackoverflow.com/questions/2402 ... -code-firs

Thanks anyway

marc

Post Reply