migdiff

command
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Command migdiff writes a new versioned migration (goose format) for one dialect by diffing ent/schema against the replayed migration directory on a dev database.

go run ./internal/tools/migdiff -dialect sqlite -name add_users
go run ./internal/tools/migdiff -dialect mysql -dev "mysql://root:pass@localhost:3306/dev" -name add_users
go run ./internal/tools/migdiff -dialect postgres -dev "postgres://u:p@localhost:5432/dev?sslmode=disable" -name add_users

SQLite uses an in-memory dev database; MySQL and PostgreSQL need a disposable, empty database (CI provides them as service containers). Commit the generated files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL