Hello
Pleas add an example on how to use the MigrationsHistoryTable Method in .NET Core.
Preferably not only with SQL Database (we are using PostgreSQL).
This would be greatly appreciated.
Kind regards, Mike
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@mjehle82 Can you give some more details of what you mean by "use the MigrationsHistoryTable"? Use in what way?
I would like to have the MigrationsHistoryTable in a specific database schema.
As I am using PostgreSQL, currently the Table is placed in the public schema.
I am referring to this part of the page: "You can change the schema and table name using the MigrationsHistoryTable() method in OnConfiguring() (or ConfigureServices() on ASP.NET Core). Here is an example using the SQL Server EF Core provider."
There is only an example for the usage in the OnConfiguringMethod. An example for the usage in ConfigureServices would be appreciated, since I am using ASP.NET Core.
Additionally, it would be great, to have this documented not only for SQL Server but also for other database providers such as PostgreSQL.
Kind regards, Mike
services.AddDbContext<ApplicationDbContext>(options =>
options.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
x => x.MigrationsHistoryTable("__MyMigrationsHistory", "not-public")));
Most helpful comment