Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding historical SQL scripts #580

Open
philcart opened this issue Sep 10, 2024 · 2 comments
Open

Adding historical SQL scripts #580

philcart opened this issue Sep 10, 2024 · 2 comments

Comments

@philcart
Copy link

Our application is a .Net 7.0 Blazor app with a MS SQL database. The database is also used by a separate legacy app that will need to be maintained for another couple of years.

Currently all table creation/changes are done via EF migrations that run on application startup. Any view, function or procedure changes are handled via Grate migrations.

With Grate working so well, we'd like to standardise on having Grate perform all the database changes.

What's the best way of adding SQL scripts for all the historical EF migrations but not have them run?

@jswright91
Copy link

Add all of your legacy scripts, and then you can run grate with the --baseline parameter.

Baseline - This instructs grate to mark the scripts as run, but not to actually run anything against the database. Use this option if you already have scripts that have been run through other means (and BEFORE you start the new ones).

see the docs: https://erikbra.github.io/grate/configuration-options/

@philcart
Copy link
Author

@jswright91 know it's been a couple of days but wanted to thank you for the reply. Haven't tried it out yet due to shifting priorities, but that definitely looks like it'll do what we need. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants