Skip to content

twenzel/DbUp.Extensions

Repository files navigation

DbUp.Extensions

Build NuGet Version License

Maintainability Rating Reliability Rating Security Rating Bugs Vulnerabilities Coverage

Extensions for DbUp.

Usage

Install the NuGet package DbUp.Extensions.

Journaling to SQL Server with hashing

Use the JournalToSqlWithHashing builder method to use journaling to a SQL Server table with hashes of the scripts instead of just the name.

var upgrader =
	DeployChanges.To
		.SqlDatabase(connectionString)
		.WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
		.JournalToSqlWithHashing("dbo", "DbChangeLog")
		.LogToConsole()
		.Build();

Reading Liquibase changelog files

The WithLiquibaseScriptsFromFileSystem extension method can be used to read Liquibase changelog files.

var upgrader =
	DeployChanges.To
		.SqlDatabase(connectionString)
		.WithLiquibaseScriptsFromFileSystem("./dbFiles/MasterChangelog.xml")
		.LogToConsole()
		.Build();

This extension reads the Liquibase changelog xml files and converts them to SQL scripts. The SQL scripts are then executed by DbUp. Following tags are supported:

  • include (for nested changelogs)
  • sql (for inline script)
  • sqlFile (for script files)

Contexts are also supported. Define your contexts using a WithLiquibaseScriptsFromFileSystem overload.

var upgrader =
	DeployChanges.To
		.SqlDatabase(connectionString)
		.WithLiquibaseScriptsFromFileSystem("./dbFiles/MasterChangelog.xml", "release", "test")
		.LogToConsole()
		.Build();

The "splitStatements" attribute is also supported. If set to true, the SQL script will be split into individual statements using the LiquibaseScriptOptions.SplitTerminators (defaults [';', 'GO']).

About

Extensions for DbUp

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages