Hi,
I'm using the package Devart.Data.PostgreSql.EFCore 7.12.1328 and I notice that the method DbContext.Database.EnsureDeleted() does not drop the table __EFMigrationsHistory.
This is an issue because, after call EnsureDeleted(), if I try to run the migrations for this DbContext again, nothing will happen.
EnsureDeleted doesn't drop the table __EFMigrationsHistory
-
- Posts: 22
- Joined: Wed 13 Mar 2019 17:25
Re: EnsureDeleted doesn't drop the table __EFMigrationsHistory
We will investigate the possibility of removing an empty __EFMigrationsHistory table by EnsureDeleted() in EF Core.jamir.araujo wrote: ↑Wed 13 Mar 2019 18:12DbContext.Database.EnsureDeleted() does not drop the table __EFMigrationsHistory.
By Microsoft design, EnsureCreated() / EnsureDelete() do not work with __EFMigrationsHistory. Refer to viewtopic.php?t=38197.jamir.araujo wrote: ↑Wed 13 Mar 2019 18:12This is an issue because, after call EnsureDeleted(), if I try to run the migrations for this DbContext again, nothing will happen.
-
- Posts: 22
- Joined: Wed 13 Mar 2019 17:25
Re: EnsureDeleted doesn't drop the table __EFMigrationsHistory
I'm was able do figure out that calling IMigrator.Migrate("0") would circumvent the issue.
But I do disagree with your statement "By Microsoft design, EnsureCreated() / EnsureDelete() do not work with __EFMigrationsHistory".
Your own implementation for Oracle, Devart.Data.Oracle.EFCore-9.6.696, does remove the __EFMigrationsHistory table, even when the table has data.
But I do disagree with your statement "By Microsoft design, EnsureCreated() / EnsureDelete() do not work with __EFMigrationsHistory".
Your own implementation for Oracle, Devart.Data.Oracle.EFCore-9.6.696, does remove the __EFMigrationsHistory table, even when the table has data.
Re: EnsureDeleted doesn't drop the table __EFMigrationsHistory
The bug with removing an empty __EFMigrationsHistory table by EnsureDeleted() in EF Core 2 for PostgreSQL 9.0 and higher is fixed. Are you interested in the internal build with the fix?
-
- Posts: 22
- Joined: Wed 13 Mar 2019 17:25
Re: EnsureDeleted doesn't drop the table __EFMigrationsHistory
No. At the moment I'm using the IMigrator.Migrate("0") workaround.
Re: EnsureDeleted doesn't drop the table __EFMigrationsHistory
The bug with removing an empty __EFMigrationsHistory table by EnsureDeleted() in EF Core 2 for PostgreSQL 9.0 and higher is fixed: viewtopic.php?f=3&t=38516.