private static void MigrateTenantDatabase(MigratorTenantInfo t)
        {
            var dbMigrator = new MigratorLoggingDecorator(
                new DbMigrator(new Configuration
            {
                TargetDatabase = new DbConnectionInfo(t.ConnectionString, "System.Data.SqlClient")
            }),
                new EfLogger(t)
                );

            try
            {
                dbMigrator.Update();
            }
            catch (Exception e)
            {
                Log.Error(e, $"Error executing migrations for {t.Name}");
                throw;
            }
        }
Beispiel #2
0
 public EfLogger(MigratorTenantInfo tenantInfo) => _tenantInfo = tenantInfo;