I have created an initial migration with Add-Migration
. When I run Update-Database
on an empty DB it creates all tables, including adding an entry in the __MigrationHistory table.
Now I run Update-Database
again just to test, and instead of "No changes detected" I get this:
PM> Update-Database -Verbose -Project testProject.Web
Using StartUp project 'testProject.Web'.
Target database is: 'testProject_dbo' (DataSource: localhost, Provider: Devart.Data.MySql, Origin: Explicit).
Applying explicit migrations: [201203151243164_Start].
Applying explicit migration: 201203151243164_Start.
CREATE TABLE attachments (
...table data...
)
Table 'attachments' already exists
Table 'attachments' already exists
It seems like the update is unaware of the current DB state. The only solution is to delete all tables and update. That works also if I add more migrations.
As you see, I am using a different database provider than usual (Devart.Data.Mysql), but I'm not sure if the problem is there. Maybe I'm missing something trivial?