chucknorris / roundhouse

RoundhousE is a Database Migration Utility for .NET using sql files and versioning based on source control
http://projectroundhouse.org
917 stars 249 forks source link

Run two seperate roundhouse migrations against the same DB #372

Closed iby-dev closed 4 years ago

iby-dev commented 5 years ago

Is it possible for one DB that already has roundhouse migrations setup to run against it but to also accept migrations from a different roundhouse project residing in a different repository altogether?

I have one DB that i have already ran migrations against, small schema with a handful of tables. Ideally I would like to also run the migrations from a different project? Both projects are small and there is no overlap on either of two schemas.

Is there anyway to achieve this? I really don't want to have to 2 Dbs - anyways I can keep migrations seperate but deploy against some DB?

erikbra commented 4 years ago

@iby-dev Have you tried it? It's not a scenario I have thought of, but when you mention it, it might work. Because the RoundhousE.ScriptsRun tables only records what is run, and a hash of the contents of what is run. If it is already run, it is not run again.

You will of course have problems if you have scripts with the same name in both repos.

I cannot guarantee that this will work, and I would try it on a copy of your database first, of course. But it might work.

iby-dev commented 4 years ago

it does work but it can get messy - ideally what you want is seperate rh schemas so that you can target it as a command line switch. Definiately feels like a worth upgrade to me? Applogies i got side tracked for months and completely forgot all about this.