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

Repeatable migrations #123

Open
lowlydba opened this issue Feb 25, 2021 · 3 comments
Open

Repeatable migrations #123

lowlydba opened this issue Feb 25, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@lowlydba
Copy link
Contributor

Being able to specify a script (via filename or special directory) that gets re-applied whenever the hash changes. It would be dependent on #120 getting done (adding file hashes), but IMO would bridge the feature parity gap between Flyway and Dbops for 99% of use cases.

Thanks again for a great tool! I'd be happy to help do some work towards this if needed.

@nvarscar
Copy link
Collaborator

Now that I have a working example of an enhanced table, I would like to get more input on how you envision this working.

Currently, there is already an option to run a modified script if you're using DBOps packages, which store hashes internally and are able to distinct if a script on a filesystem is different from how it was imported into a build previously.

I imagine that you're talking about achieving similar functionality in Install-DBOScript without having to build packages - by comparing every script's hash with a recorded hash from when that particular script was previously executed. Is that right?

@nvarscar nvarscar added the enhancement New feature or request label May 12, 2021
@lowlydba
Copy link
Contributor Author

That's correct. In our setup we aren't quite able to utilize the full fledged CI/CD workflow currently, so we're just relying on the Install-DboScript command to do migrations.

Comparing the hashes would make it a lot easier to have a View definition live in a single script, versus having to create a new migration script for it per change when using Install-DboScript. I'm not sure if it makes more sense to just apply this logic to all scripts, or only apply it to a folder like PreScripts.

This may be a bit of an edge case, so thanks for looking into it!

@nvarscar
Copy link
Collaborator

The more I look at it, the more I think that this functionality would benefit the module greatly, perhaps offering a third potential pipeline scenario that supports modified files.

It seems, however, that it's not going to be a quick win. The only validation DbUp UpgradeEngine class does is script name validation, and the overrides might not be so easy to implement. But I'll give it an honest attempt at the very least.

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

No branches or pull requests

2 participants