Method EnsureAsync(IRedbContext, ISqlDialect, bool, ILogger?, CancellationToken)
Removes the empty root duplicates and builds the key when none with values remain. Called only for a dialect
whose is not null.
public static Task<bool> EnsureAsync(IRedbContext context, ISqlDialect sql, bool hasMigrationsTable, ILogger? logger, CancellationToken cancellationToken = default)