-
Notifications
You must be signed in to change notification settings - Fork 324
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
drop view before modifying table fields #2313
Conversation
Signed-off-by: Pawel Leszczynski <leszczynski.pawel@gmail.com>
1fb887a
to
6e07904
Compare
Codecov Report
@@ Coverage Diff @@
## main #2313 +/- ##
=========================================
Coverage 77.01% 77.01%
Complexity 1166 1166
=========================================
Files 222 222
Lines 5307 5307
Branches 424 424
=========================================
Hits 4087 4087
Misses 747 747
Partials 473 473 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -1,2 +1,3 @@ | |||
/* SPDX-License-Identifier: Apache-2.0 */ | |||
DROP VIEW IF EXISTS datasets_view; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://flywaydb.org/documentation/concepts/migrations.html#repeatable-migrations
Repeatable migrations have a description and a checksum, but no version. Instead of being run just once, they are (re-)applied every time their checksum changes.
Within a single migration run, repeatable migrations are always applied last, after all pending versioned migrations have been executed. Repeatable migrations are applied in the order of their description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the doc says, they are (re-)applied every time their checksum changes.
Just dropping the view will not create a view again and the application will break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should drop and recreate a view after altering like above PR.
Signed-off-by: Pawel Leszczynski leszczynski.pawel@gmail.com
Problem
V52 migration script is failing.
Closes: #2298
Solution
drop view and let it being recreated by flyway after the migration.
Checklist
CHANGELOG.md
with details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary).sql
database schema migration according to Flyway's naming convention (if relevant)