DEV Community

Discussion on: How to work with stored procedures and not die trying

Collapse
 
pesse profile image
Samuel Nitsche

What bothers me most with using Visual Studio for my (very procedure-heavy and db-centric) database project is that Visual Studio encourages you to use a state-based publishing strategy. It works fine as long as you're working with stored procedures only or and are able to create all the tables from scratch if you have to change them.
The moment you try to do migrations like alter table or even data migrations (you might need them at some point if you for example also store metadata in the database or if you want to refactor your data tables) there are massive pitfalls with that approach.

I started using using flyway some months ago for the database migrations and was able to overcome serious problems we previously had with the publish-approach of Visual Studio (also blogged about it: cleandatabase.wordpress.com/2017/1...)

Collapse
 
hardkoded profile image
Darío Kondratiuk

Regarding the migration process, Visual Studio keeps track of refactors in a refactorlog file. So if you rename the table Foo to Var it won't try to drop Foo and create Var, it'll perform a table rename.

But when we start talking about data... yeah, that's a headache.

I'll take a look at your post!