Open emilianosantucci opened 1 week ago
Migrations typically have to contain valid SQL.
I am not aware that Go code would be used by any driver currently available in this project.
There are open issues and PRs for that, but nothing merged yet.
Where did you read that migrations can consist of Go code?
Describe the Bug Failed to use .go files as migration files with CLI
Steps to Reproduce
mydb
)Create this project structure:
Each file contains go code like below:
Expected Behavior Migrate interprets migration files and execute them appropriately
Migrate Version v4.18.1
Loaded Source Drivers file
Loaded Database Drivers postgres
Go Version go version go1.23.1 darwin/arm64
Stacktrace
Additional context I don't know if really is it a bug, a wrong use of the CLI or my mistake. I have not found any official documentation on using go, instead of sql, for migration files.
My goal is using
mapper
integrated with GORM and Uber FX to automate db migrations process. The usage of SQL files is not a suitable options for my project 'cause I can't use GORM AutoMigrate (+ custom logic) to handle db versioning.