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
9
votes
1 answer

How to apply EF Core migrations if you should not use MigrateAsync() for production environments?

I created a new .Net 5 project and want to use EF Core. I autogenerated multiple migration.cs files using dotnet ef migrations add MyMigration and want to apply them (for development and production). I know about the MigrateAsync method so I read…
Question3r
  • 2,166
  • 19
  • 100
  • 200
6
votes
2 answers

Entity Framework Code First with DbUp

I am thinking of using Entity Framework 6 Code First for database interaction alongside DbUp for database schema update. The thing is I don't want to use EF migration for reasons. So, the workflow that I've reached to is: Change model (add POCOs,…
Hans
  • 2,674
  • 4
  • 25
  • 48
5
votes
0 answers

Using dbup in concurrent environment

We have multiple binaries/processes that references the same backend database for load-balancing, went through the documentation but didn't find much information on any best practices for updating database in concurrent environment. Does anyone have…
Wahab Akhtar
  • 105
  • 6
4
votes
0 answers

Automatic database update with DbUp in multi application environment

I have multiple desktop apps that can run DbUp at startup. And how to handle this situation if couple apps run DbUp at the same time? I have to have automatic solution for that because there are plenty clients and DB update cannot be run by the DBA.…
Viktorasd
  • 41
  • 3
4
votes
1 answer

C# + DockerCompose - Wait for MS SQL Server Docker container to be up before trying to connect

I am trying to create integration tests for my microservices similar to Spotify's approach. I am still working on how to spin up and seed the database. Currently I have a .NET Core 2.0 project with FluentDocker v2.2.15 and DbUp 4.1.0. I use…
peflorencio
  • 2,284
  • 2
  • 32
  • 40
2
votes
1 answer

Dacpac publish how to ignore create database statement?

Due to shared database, we don't have admin privs. Only we have schema id. In dacpac build or sqlpackage.exe publish is there anyway to ignore the Create database statement ? 2020-03-23T21:48:54.5875811Z ##[error]*** Could not deploy…
2
votes
1 answer

Force DBUP to rerun new scripts during development

We're using DBUP to handle db migrations. Each release, we would like to run the dbup console app with a command line switch so that during dev we can re-run our scripts while we're working on them, however we don't want it to re-run all the…
Shawson
  • 1,858
  • 2
  • 24
  • 38
2
votes
1 answer

Database Migration with the flyway or dbup(.net library/dbup extension) with PostgreSQL

First of all, I am sorry because it might be a stupid question but after a day research I am confused and I have a very less time to decide. We are using TFS as a CI tool and as an SCM. And Postgresql for DB. Planning to Automate DB with Postgresql…
Darshana Patel
  • 507
  • 1
  • 11
  • 25
2
votes
1 answer

Unit Test (Rhino) DBUp in Azure Durable HTTPStart Method

Technology Stack DBUP for DB upgrades Azure Durable for activities Rhino mocks for unit testing. Situation Currently, I have placed my DB Upgrade (DBUp) statements in the HTTPStart method as its the entry point of my durable azure…
Tarun Bhatt
  • 727
  • 2
  • 8
  • 28
1
vote
1 answer

DbUp for sqlserver creates schemas under dbo authorization for non dbo user

I'm trying to understand the underlying reason as to why DbUp upgrade creates schemas under dbo authorization, when the login/user in the connection string is neither an "owner", nor has "db_owner" role assigned. To elaborate, let's say I manually…
RollerMobster
  • 864
  • 1
  • 10
  • 28
1
vote
1 answer

DBUP - Running Script in Order

I am trying out DBUP and can't seem to get it working. I have split my scripts into different directory and prefixed them with the number order they are suppose to be run. As far I know DBUP is suppose to run the script based on the Directory…
Jack Thor
  • 1,554
  • 4
  • 24
  • 53
1
vote
0 answers

DbUp - NullReferenceException when using SqlTableJournal

I get the following error when using a SqlTableJournal or when using a custom Journal that implements TableJournal. If I change the DeployChanges.To... code and remove the .JournalTo(journal) line, the problem goes away. My main goals is to add more…
1
vote
1 answer

DbUp throwing Npgsql exception when using SQL-language syntax for PostgreSQL functions

I'm using DbUp to deploy to a PostgreSQL-14 database. When I try to create a function or procedure using SQL-language syntax, DbUp throws an Npgsql.PostgresException 42601, claiming there's a syntax error. I've run the below code successfully using…
1
vote
1 answer

How to rollback transactions SQL Server Scripts?

I am using DbUp (Documentation) package to maintain and execute scripts on the database. Currently, I am using var builder = DeployChanges.To .SqlDatabase(connectionString) …
Shishank Jain
  • 13
  • 1
  • 5
1
vote
1 answer

Oracle - cannot alter procedure

When DbUp executes the following SQL script, I get an error as shown further down: CREATE OR REPLACE PROCEDURE INVOICE_DELETE (PAR_INVOICE_ID IN NUMBER) AS BEGIN DELETE FROM INVOICE_SECT_ACCOUNTING_DATA WHERE INVOICE_ID =…
Igor Semkiv
  • 251
  • 2
  • 11
1
2 3 4