Created
October 28, 2011 01:27
-
-
Save shiftkey/1321405 to your computer and use it in GitHub Desktop.
DbUp Setup Changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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