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

drop view before modifying table fields #2313

Closed
wants to merge 1 commit into from

Conversation

pawel-big-lebowski
Copy link
Collaborator

@pawel-big-lebowski pawel-big-lebowski commented Dec 12, 2022

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.

Note: All database schema changes require discussion. Please link the issue for context.

Checklist

  • You've signed-off your work
  • [] Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • You've updated the CHANGELOG.md with details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary)
  • You've versioned your .sql database schema migration according to Flyway's naming convention (if relevant)
  • You've included a header in any source code files (if relevant)

@boring-cyborg boring-cyborg bot added the api API layer changes label Dec 12, 2022
Signed-off-by: Pawel Leszczynski <leszczynski.pawel@gmail.com>
@pawel-big-lebowski pawel-big-lebowski force-pushed the fix/v52_migration_scripts_breaks branch from 1fb887a to 6e07904 Compare December 12, 2022 10:58
@boring-cyborg boring-cyborg bot added the docs label Dec 12, 2022
@pawel-big-lebowski pawel-big-lebowski marked this pull request as ready for review December 12, 2022 11:01
@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Merging #2313 (6e07904) into main (68fcb96) will not change coverage.
The diff coverage is n/a.

@@            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;
Copy link
Collaborator Author

@pawel-big-lebowski pawel-big-lebowski Dec 12, 2022

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.

Copy link
Collaborator

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.

Copy link
Collaborator

@fm100 fm100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2308

We should drop and recreate a view after altering like above PR.

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

Successfully merging this pull request may close these issues.

V52 database migration breaks existing Marquez installations
2 participants