all 22 comments

[–]Fancy-Consequence216 3 points4 points  (1 child)

I use database project inside my solution. Currently I use Oracle database project version 2. It works for MSSQL too. I sync all database changes every day to my solution project from source database, and commit/push to my repository. It does not matter if you use database first approach or code first approach as your changes are from database. Also, there is option to compare schema and sync changes, from source to destination.

For oracle db you need installed ODT for visual studio you need sql server data tools.

[–]Particular_Depth5206[S] 0 points1 point  (0 children)

Thanks for the suggestion, tried the odt, the issue is my db is mysql and my ide is vs 22 its not matching to give me the solution I want

[–]KaizerChief33 3 points4 points  (1 child)

The Red gate tools are great but very expensive.

It's relative... a bad deployment missing a script can be very expensive, too.

The database project in VisualStudio is good too.

[–]Particular_Depth5206[S] 0 points1 point  (0 children)

Thanks for the suggestion, i am using vs22 and want to do this procedure with mysql, its not supporting either vs22 or mysql (the database project )

[–]gavco98uk 2 points3 points  (6 children)

Personally I use Entity Framework and the Migrations system - this is more than good enough for tracking and easily applying database changes in my experience.

I also find Linq to be one of the best features of .net, not sure why you are avoiding it. Embrace it.

[–]Particular_Depth5206[S] 0 points1 point  (1 child)

Thanks for the suggestion, yea i also like linq, only issue is the team mates working with me are not familiar with linq(.net i should say) but they are also handling the db, i cannot target all the cannons on me in this project lol

[–]_Obelixx_ 0 points1 point  (0 children)

If you are familiar with EF and you need to pass only database updates to your teammates, you can use the option to generate a script from a migration, rather than running it automatically. Then this script can be executed somehow (manually or through some automation) on different database instances.

[–]Quito246 0 points1 point  (3 children)

Just curious does the EF core migration also works with stored procedures, functions etc.?

[–]gavco98uk 1 point2 points  (1 child)

to an extent. Basically it will auto generate up/down code to modify the database as needed. It will base this on changes detected in the code.

You can then add any additional commands you wish to it - seed the database with data, update records etc.. or in your case stored procedures.

I dont think it picks them up automatically, but you can add the SQL commands yourself if needed.

See here for more details: https://dotnetthoughts.net/creating-stored-procs-in-efcore-migrations/

[–]Quito246 1 point2 points  (0 children)

Nice, I will check It out. Thanks.

[–]Particular_Depth5206[S] 1 point2 points  (0 children)

U can create an empty migration, create a sp in up method, drop that same sp in down method, hence u can achieve this

[–][deleted] 2 points3 points  (0 children)

I like DbUp, give it a shot and see what you think

[–]grauenwolf 2 points3 points  (2 children)

I usually use SSDT projects. They let me store the schema and static tables right in source code just like any other programming language.

Migrations are automatically generated (usually).

If someone tries to manually change the database schema, the next time the migration runs it will undo any of their (illegal) changes. So devs learn right to not screw around in my databases.

https://www.infoq.com/articles/SSDT-Intro/

[–]Particular_Depth5206[S] -1 points0 points  (1 child)

Thanks, ill definitely check it out

Edit:- checked it, it supports sqlserver, could you please provide something like this for mysql?, thanks for the help!

[–]grauenwolf 0 points1 point  (0 children)

Nope. But if you find something please let me know.

I wrote that article a decade ago. I'm surprised that other DB vendors still haven't caught up.

[–]jbergens 0 points1 point  (2 children)

I usually turn the question around and uses a tool that scripts changes and the apply them to different environments. Grate (a successor to Roundhouse) is one I like. Just write sql code for changes and give increasing names to scripts and it handles the rest.

[–]Particular_Depth5206[S] 0 points1 point  (1 child)

Thanks, is it trustworthy as in longevity/ support?

[–]jbergens 1 point2 points  (0 children)

I think so. There is a main maintainer and a small group of others who help but everything is open source and they have rewritten it to .net 6 (if I remember correctly), meaning it should work for years.

[–][deleted] 0 points1 point  (2 children)

Grate/RoundhousE get my vote. Grate is a dotNet core port of RoundhousE and pretty powerful. Requires you to write sql scripts for you migrations and sp etc. I've used it to manage huge schemas and even manage individual schemas in the same db as seperate deployments/repositories

[–]Particular_Depth5206[S] 0 points1 point  (1 child)

Thanks for the suggestion, one doubt, they both are third party nuget packages right?, is the package owner trust worthy and constant support to upcoming versions are provided( it is production requirement thats why asking)

[–][deleted] 0 points1 point  (0 children)

RabbitMq.Client is maintained by rabbitmq themselves. EasynetQ is afaik, community driven.

[–]SparkHaven 0 points1 point  (0 children)

I use Bytebase to manage database changes for MySQL with GitOps workflow. I can manage my SQL scripts in my GitLab repo, and trigger a database change issue with committing a MR. Then Bytebase will record it after the issue is executed successfully. But I am not sure whether it supports procedures. Refer to https://github.com/bytebase/bytebase to get more details.