Closed ehsanYazdani closed 2 weeks ago
Workaround method what i use
public class CustomClickHouseHistoryRepository : ClickHouseHistoryRepository {
public CustomClickHouseHistoryRepository(HistoryRepositoryDependencies dependencies) : base(dependencies) {
}
protected override void ConfigureTable(EntityTypeBuilder<HistoryRow> history) {
history.Property<string>(h => h.MigrationId).HasMaxLength(150);
history.Property<string>(h => h.ProductVersion).HasMaxLength(32).IsRequired(true);
history.ToTable("__EFMigrationsHistory", table => table
.HasMergeTreeEngine()
.WithPrimaryKey("MigrationId"));
}
}
Into ClickHouseDbContext
protected override void OnConfiguring(DbContextOptionsBuilder options) {
options.ReplaceService<IHistoryRepository, CustomClickHouseHistoryRepository>();
}
Thanks for the workaround @AniMeIIIkA. It works great. However, I'm still curious to hear why @denis-ivanov has chosen stripelog was chosen as the default engine.
@ehsanYazdani, I do not use ClickHouse cloud. StripeLog was the easiest way to start writing functional tests.
@AniMeIIIkA, thanks for workground. I changed default behavior.
Please correct me if I'm wrong but from what I can see in the code base the default engine is StripeLog unless explicitly annotated on an entity type. For the history log table, however, (again to my understanding) there is no way of providing an annotation and hence the table is created with StripeLog engine. Unfortunately Clickhouse Cloud does not support StripeLog as it runs the service on multiple (distributed) instances.
I'm curious to hear why StripeLog is default in this lib whereas MergeTree is default in Clickhouse? In any case, is there anyway the engine for the history table can be customized?