Skip to content

z0ne-dev/mgx

Repository files navigation

Contributors Forks Stargazers Issues Apache 2.0

Go Reference Build Coverage Go Report Card

mgx

Simple migration system for pgx.

Migrations are defined in code and are executed in order. The migration system keeps track of which migrations have been executed and which have not.

Getting Started

  1. Install the dependency
go get -u github.com/z0ne-dev/mgx/v2
  1. Import the package and create a new migrator
package main

import "github.com/z0ne-dev/mgx"

func main() {
    migrator, _ := mgx.New(mgx.Migrations(
		// insert migrations here 
    ))
}
  1. Run the Migrate(context.TODO(), pgx) method to execute the migrations

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache-2.0 License. See LICENSE for more information.

Acknowledgments

  • lopezator/migrator for inspiration for this package. Lots of inspiration was taken from this package, but it was not used directly. The API was designed to be similar, to reduce refactoring when switching between the two packages.