Categorygithub.com/Soemii/migrago
repositorypackage
1.0.1
Repository: https://github.com/soemii/migrago.git
Documentation: pkg.go.dev

# README

migrago

Database migration tool for go projects

Currently only supports postgres databases

WARNING

This is a work in progress and should not be used in production

features

  • Database migration
  • Rollback migration
  • Configurable migration directory
  • Support postgres
  • Support mysql
  • Support sqlite

installation

use the following command to install the package

go get github.com/Soemii/[email protected]

usage

db, err := sql.Open("postgres", dsn)
if err != nil {
	return nil, err
}
fs := os.DirFS("migration")
service := migrago.NewMigrationService("config.json", "scripts", fs, db)
err = service.ExecuteMigration(context.Background())

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT