public async Task EnsureBaseSchemaExist_DoesNotExist_CreatesIt() { Assert.False(await _dataStore.BaseSchemaExistsAsync(CancellationToken.None)); await _runner.EnsureBaseSchemaExistsAsync(CancellationToken.None); Assert.True(await _dataStore.BaseSchemaExistsAsync(CancellationToken.None)); }
public async Task EnsureBaseSchemaExistsAsync(CancellationToken cancellationToken) { IBaseScriptProvider baseScriptProvider = new BaseScriptProvider(); await InitializeAsync(cancellationToken); if (!await _schemaManagerDataStore.BaseSchemaExistsAsync(cancellationToken)) { var script = baseScriptProvider.GetScript(); _logger.LogInformation(Resources.BaseSchemaExecuting); await _schemaManagerDataStore.ExecuteScriptAsync(script, cancellationToken); _logger.LogInformation(Resources.BaseSchemaSuccess); } else { _logger.LogWarning(Resources.BaseSchemaAlreadyExists); } }