Skip to content

Instantly share code, notes, and snippets.

@shiftkey
Created October 28, 2011 01:27
Show Gist options
  • Save shiftkey/1321405 to your computer and use it in GitHub Desktop.
Save shiftkey/1321405 to your computer and use it in GitHub Desktop.
DbUp Setup Changes
Version 1:
var upgrader = new DatabaseUpgrader(
Settings.Default.MyDbConnectionString,
new EmbeddedScriptProvider(typeof(Program).Assembly)
);
Version 2:
Func<IDbConnection> connectionFactory = () => new SqlConnection(Settings.Default.Database);
var config = new UpgradeConfiguration();
var provider = new FileSystemScriptProvider("./Scripts");
var logger = new ConsoleUpgradeLog();
config.Journal = new SqlTableJournal(connectionFactory, "dbo", "Version", logger);
config.ScriptProviders.Add(provider);
config.ScriptExecutor = new SqlScriptExecutor(connectionFactory, () => logger, "dbo", new List<IScriptPreprocessor>());
config.ConnectionFactory = connectionFactory;
var upgrader = new UpgradeEngine(config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment