protected override void Setup(FeatureConfigurationContext context) { var settings = context.Settings.Get <InstallerSettings>(); if (settings.Disabled) { return; } settings.ConnectionBuilder = context.Settings.GetConnectionBuilder(); settings.Dialect = context.Settings.GetSqlDialect(); settings.ScriptDirectory = ScriptLocation.FindScriptDirectory(context.Settings); settings.TablePrefix = context.Settings.GetTablePrefix(); settings.Dialect.ValidateTablePrefix(settings.TablePrefix); }
protected override void Setup(FeatureConfigurationContext context) { var settings = context.Settings.Get <InstallerSettings>(); if (settings.Disabled) { return; } settings.ConnectionBuilder = storageType => context.Settings.GetConnectionBuilder(storageType).BuildNonContextual(); settings.Dialect = context.Settings.GetSqlDialect(); settings.ScriptDirectory = ScriptLocation.FindScriptDirectory(context.Settings); settings.TablePrefix = context.Settings.GetTablePrefix(); settings.IsMultiTenant = context.Settings.EndpointIsMultiTenant(); settings.Dialect.ValidateTablePrefix(settings.TablePrefix); }
public async Task Install(string identity) { var connectionBuilder = settings.GetConnectionBuilder(); var sqlVariant = settings.GetSqlVariant(); var schema = settings.GetSchema(); var scriptDirectory = ScriptLocation.FindScriptDirectory(sqlVariant); var tablePrefix = settings.GetTablePrefix(); ConfigValidation.ValidateTableSettings(sqlVariant, tablePrefix, schema); using (var connection = await connectionBuilder.OpenConnection().ConfigureAwait(false)) using (var transaction = connection.BeginTransaction()) { await InstallOutbox(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false); await InstallSagas(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false); await InstallSubscriptions(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false); await InstallTimeouts(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false); transaction.Commit(); } }