Skip to content

feat: add format flag, add support for goose format - #32

Open
Gornius wants to merge 1 commit into
thecodearcher:masterfrom
Gornius:feature/sql-format
Open

feat: add format flag, add support for goose format#32
Gornius wants to merge 1 commit into
thecodearcher:masterfrom
Gornius:feature/sql-format

Conversation

@Gornius

@Gornius Gornius commented Aug 12, 2026

Copy link
Copy Markdown

Issue

goose uses its internal annotations to determine whether a migration is an up migration or down migration. Running generated migrations using goose results in migration duplication error.

Changes

To resolve this issue I added a new flag --format (-f) to generate migrations command. It defaults to golang-migrate format, which uses GolangMigrateCompatibleSqlWriter that is a copy-paste of previous behavior.

Setting format to goose outputs migration to single file, adds goose annotations, and removes .up, and .down from filename (as files now both have up and down commands).

goose happily accepts files generated this way and successfully migrates to new database state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant