public static void MigrateSchema() { log.Debug("Applying any required schema updates"); var announcer = new MigrationAnnoucer(message => log.Debug(message), message => log.Error(message)); var runner = new RunnerContext(announcer) { Database = "SqlServer", Connection = SessionProvider.ConnectionSettings.ConnectionString, Target = Path.Combine(AppDomain.CurrentDomain.SetupInformation.PrivateBinPath, Assembly.GetExecutingAssembly().GetName().Name + ".dll") }; new TaskExecutor(runner).Execute(); }
public static void MigrateSchema() { log.Debug("Applying any required schema updates"); var announcer = new MigrationAnnoucer(message => log.Debug(message), message => log.Error(message)); var runner = new RunnerContext(announcer) { Database = "SqlServer", Connection = SessionProvider.ConnectionSettings.ConnectionString, Target = Path.Combine(AppDomain.CurrentDomain.SetupInformation.PrivateBinPath, Assembly.GetExecutingAssembly().GetName().Name + ".dll") }; new TaskExecutor(runner).Execute(); }
public virtual void UseLatestDatabaseSchema() { var announcer = new MigrationAnnoucer(message => Debug.WriteLineIf(Debugger.IsAttached, message), message => Debug.WriteLineIf(Debugger.IsAttached, message)) { ShowSql = true }; var runner = new RunnerContext(announcer) { Database = "SqlServer", Connection = ConnectionString, Target = Path.Combine(Environment.CurrentDirectory, CoreAssemblyName + ".dll"), ApplicationContext = "LocalDb" }; new TaskExecutor(runner).Execute(); }
public virtual void RollbackDatabaseSchema(long version = 0) { var announcer = new MigrationAnnoucer(message => Debug.WriteLineIf(Debugger.IsAttached, message), message => Debug.WriteLineIf(Debugger.IsAttached, message)) { ShowSql = true }; var runner = new RunnerContext(announcer) { Database = "SqlServer", Connection = ConnectionString, Target = Path.Combine(Environment.CurrentDirectory, CoreAssemblyName + ".dll"), Task = "migrate:down", Version = version, ApplicationContext = "LocalDb" }; new TaskExecutor(runner).Execute(); }