Go PostgreSQL database schema migration library.
In theory, you can also make an implementation for any database using mig.Database interface and instantiate mig using mig.New constructor. Since there are other migration libraries supporting multiple databases using Go's standard library's interface database/sql, this project has no intention to make such implementations since there is no other library specific to pgx driver. As of now, there is only tern CLI, but it doesn't provide a library.
This project is in an early stage so you can expect API breaking changes until the first major release.
1-initial.sql
2-alter-some-table.sql
...
or
001-initial.sql
002-alter-some-table.sql
mig will try to parse the number prefix in the correct order without matter if it is prefixed with zeroes or not. So, in theory, the following migration files should also work as expected:
001-initial.sql
2-alter-some-table.sql
03-insert-some-fixed-data.sql
...
make start
to start the docker-compose with PostgreSQL and adminermake test
to run all testsmake stop
so that newmake start
gets clean database
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.