Questions tagged [dbup]

DbUp is the little script runner which helps you to deploy changes to databases. It is an open source .NET library. It tracks which SQL scripts have been run already, and runs the change scripts that are needed to get your database up to date.

DbUp uses a builder to configure your database deployments. This library's entry point is DeployChanges.To followed by extension methods for all of the supported databases. You can find the source code on GitHub.

Here is the sample code to configure DbUp in your console application.

var runner = DeployChanges.To
    .SqlDatabase(connectionString)
    .WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
    .LogToConsole()
    .Build();
49 questions
1
vote
2 answers

Getting a NullReferenceException when using dotnet run --project option

I'm trying to run my project file using the dotnet run --project syntax but I get a NullReferenceException as shown: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at…
Izak Joubert
  • 906
  • 11
  • 29
1
vote
2 answers

"EnsureDatabase" fails the first time with: "Database not found on server with connection string in settings"

I am trying to use DbUp to set up migration scripts for my Database. Problem is whenever I use: var connectionString = configuration.GetSection("DbSetting").Get().ConnectionString; EnsureDatabase.For.SqlDatabase(connectionString); The…
Tarta
  • 1,729
  • 1
  • 29
  • 63
1
vote
0 answers

Error while using DBUP through PowerShell scripts to deploy scripts on SQL Server

Use DBUp DLL in PowerShell script to deploy SQL database scripts. $databaseServer = $args['localhost\SQLEXPRESS'] $databaseName = $args['TestDatabase'] $scriptPath = …
Nitin Jain
  • 129
  • 1
  • 14
1
vote
1 answer

EnsureDatabase.For.SqlDatabase throws exception

I'm using DbUp to migrate my SQL Server database. I've implemented this in a console application, that accepts the connection string. If I run this against my local SQL Server database, it works. If I run it against an Azure SQL database, it works…
L-Four
  • 13,345
  • 9
  • 65
  • 109
1
vote
1 answer

Dbup(.net library) with Powershell for Postgresql

With the reference of this link I am trying to run dbup through powershell script for the Postgresql DB. But, stuck with an error- Powershell script- $scriptPath =…
1
vote
1 answer

Getting 'relation "schemaversions" does not exist error'

Im trying to use the example code from dbup converted to postgres. Below is the code. using System; using System.Linq; using System.Reflection; using DbUp; namespace GeoServerDbManager { //"Host = 1.1.1.1; User Id = postgres; Password =…
Tommie Jones
  • 957
  • 1
  • 16
  • 37
1
vote
1 answer

Performing C# (procedural) migrations with DbUp

Using DbUp, is it possible to write a procedural migration in C# (rather than SQL)? I realise the general philosophy of DbUp is to do everything in SQL but there might be cases where C# is the better tool for the job. For example let's say you're…
eddiewould
  • 1,555
  • 16
  • 36
1
vote
2 answers

How to run "deploy a package step" on Octopus server same as script task step

We are using octopus deploy as Continuous delivery. We have already setup all web related configuration on octopus "Deploy Package Step" where we are deploying nuget package to octopus server and then it is deploying the application to multiple…
Amit Kumar
  • 79
  • 1
  • 10
1
vote
0 answers

dbup dotnet core support issue

i tried to get dbup from nuget for my asp.net core 1.1 project Install-Package dbup-mysql -Version 3.3.5 and end up with this issue. Install-Package : Package dbup-mysql 3.3.5 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1).…
Gayan
  • 2,750
  • 5
  • 47
  • 88
1
vote
1 answer

Concurrent Feature Development with Database Deployment Tool

I am looking for a specific strategy / convention that works for concurrent development with Feature branches and a database deployment tool such as DbUp, DbDeploy, ReadyRoll, etc. We run multiple feature branches for concurrent project…
JDBennett
  • 1,323
  • 17
  • 45
1
vote
2 answers

Do something when a single upgrade script has failed in DbUp

Given we have DbUp set to look at our local filesystem set up as follows DeployChanges.To .SqlDatabase(ConnectionString) .WithTransactionPerScript() .WithScriptsFromFileSystem(ScriptsPath) .LogToConsole() .Build() …
Jay Wick
  • 12,325
  • 10
  • 54
  • 78
0
votes
0 answers

DbUp not appearing in menu

I have installed DbUp for VS2022. I can see that it is installed when I go to Extensions/Manage Extensions (circle green tick icon) But when I go to the solution and do Add the Add DbUp does not appear on the sub menu. What is going on? I've tried…
Azven
  • 29
  • 2
0
votes
1 answer

MySQL script migration with dbup error at SET MESSAGE_TEXT line

I'm trying to use dbup to automate running db scripts in my .NET 7 app. So far the scripts to create tables are fine (ofcourse after making lots of tweeks), but the stored procedures are being problematic. ... BEGIN IF (SELECT COUNT(*) FROM…
Able
  • 49
  • 4
0
votes
1 answer

Postgres Azure AD admin privileges fails on GRANT

I've set up my Postgres flexible server in Azure to use Azure AD admins and added a service principal as the admin (nevermind the added user in the screenshot, that was just an experiment): Now, I want the ServicePrincipal AD admin to be able to do…
bomortensen
  • 3,346
  • 10
  • 53
  • 74
0
votes
1 answer

syntax error when deploying DBUP script through octtopus

I have DBUP scripts in the .Net Frameowrk4.5 project. For some reason when deploying the project through octopus, I get the below syntax error. This works ok on the local SQL server. This is script I get below error
Fahad Ali
  • 75
  • 1
  • 5