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

chore: upgrade h2 database #5917

Merged
merged 1 commit into from Dec 12, 2023
Merged

chore: upgrade h2 database #5917

merged 1 commit into from Dec 12, 2023

Conversation

kasiaMarek
Copy link
Contributor

resolves: #5447

Do we want to fallback to deleting the db if this mechanism fails?

@tgodzik
Copy link
Contributor

tgodzik commented Dec 6, 2023

resolves: #5447

Do we want to fallback to deleting the db if this mechanism fails?

That seems to be a good ide 👍

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Great work! Let's merge this after the next release!

private def upgradeIfNeeded(url: String): Unit = {
val oldVersion = 214
val formatVersionChangedMessage =
"The write format 2 is smaller than the supported format 3"
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance we can match on an exact error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could not check the exact message and just the error code. Trouble is that we wouldn't know the versions are2 and 3, so if it changes again in the future, it might be 3 and 4. Maybe it doesn't matter so much since it will fail if the versions change again anyway. Otherwise (looking at the source code), the versions in the error are only in the message I'm afraid.

registerNiceToHaveFilePatterns()
tables.connect()
Copy link
Member

Choose a reason for hiding this comment

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

Why is this line deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

loadFingerPrints() has to do tables.connect() anyway. It's just a duplication really.

@tgodzik tgodzik merged commit 58b9c45 into scalameta:main Dec 12, 2023
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metals H2 database error and redundant import build prompt (upgrade H2 database)
3 participants