Here is an example of how to do this on SQL Server.
First create a custom implementation of the SqlServerHistoryRepository override ConfigureTable .
class MyHistoryRepository : SqlServerHistoryRepository { public MyHistoryRepository( IDatabaseCreator databaseCreator, IRawSqlCommandBuilder rawSqlCommandBuilder, ISqlServerConnection connection, IDbContextOptions options, IMigrationsModelDiffer modelDiffer, IMigrationsSqlGenerator migrationsSqlGenerator, IRelationalAnnotationProvider annotations, ISqlGenerationHelper sqlGenerationHelper) : base(databaseCreator, rawSqlCommandBuilder, connection, options, modelDiffer, migrationsSqlGenerator, annotations, sqlGenerationHelper) { } protected override void ConfigureTable(EntityTypeBuilder<HistoryRow> history) { base.ConfigureTable(history); history.Property(h => h.MigrationId).HasColumnName("migration_id"); history.Property(h => h.ProductVersion).HasColumnName("product_version"); } }
Then replace the service with the replacement of your custom implementation.
protected override void OnConfiguring(DbContextOptionsBuilder options) => options .UseSqlServer(connectionString) .ReplaceService<SqlServerHistoryRepository, MyHistoryRepository>();
bricelam
source share