question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple Versions allowed in migration file names

See original GitHub issue

SQLDelight Version

1.5.3

Operating System

OSX

Gradle Version

7.4.2

Kotlin Version

1.6.10

Dialect

MySQL

AGP Version

No response

Describe the Bug

When using SqlDelight with FlyWay, someone named one of the migrations V12__InitialFormV2.sqm. This caused an issue where fields were being mapped in an incorrect order and values that should have been for field A were instead applied to field B. The solution was to remove the V2 from the end of V12__InitialFormV2.sqm and instead make it V12__InitialForm.sqm.

Tracking this issue down took a good amount of time, and required hacky modification flyway’s database table to fix.

It seems reasonable that SqlDelight would error when 2 versions are potentially found in the file name. I’m assuming that’s why this bug occurred.

Stacktrace

No response

Gradle Build Script

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
dbacinskicommented, Dec 5, 2022

In our case filename was V302__Salesorder_3ds_transaction.sqm, Flyway resolved version correctly as 302, but SqlDelight did something different (not sure what) so that changes form this migration were not applied. So most probably version was resolved to 3023 and migrations were not in expected order. Renaming to V302__Salesorder_threeds_transaction.sqm fixed the problem. It took hours to figure it out 😢

0reactions
hfhbdcommented, Dec 5, 2022

@dbacinski What do you mean by would match with flyway?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flyway: Naming Patterns Matter
The default naming patterns within Flyway are documented clearly. You have a prefix that determines the type of file, whether a versioned ...
Read more >
Multiple versions directories #124 - sqlalchemy/alembic
i use multiple sets of versions by just putting multiple sections in my .ini file and referring to them using the "--name" option:...
Read more >
SQL migration-scripts versions on multiple git branches
The idea is that each script number is prefixed with number increasing by the value of 10 and after that the name, so...
Read more >
Flyway by Redgate • Database Migrations Made Easy.
With Flyway all changes to the database are called migrations. Migrations can be either versioned or repeatable. Versioned migrations come in 2 forms:...
Read more >
SharePoint Migration Tool settings - Microsoft 365
Migrate file version history, If set to Off, only the most recent version ... For a complete list, see: Invalid file names and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found