Multiple Versions allowed in migration file names
See original GitHub issueSQLDelight 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:
- Created a year ago
- Reactions:1
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 toV302__Salesorder_threeds_transaction.sqm
fixed the problem. It took hours to figure it out 😢@dbacinski What do you mean by
would match with flyway
?