A Wrapper around gorm for migrations
Still a work in progress
- gorm
- go 1.18
-Import import into you project and reference github.com/dwakel/leafeon/migrator
-Can also use with terminal to run migrations
go run leafeon.go -connstr="host=localhost port=5432 user=postgres password=dbpassword dbname=dbname sslmode=disable" -src="./migrations" up
go run leafeon.go -connstr="host=localhost port=5432 user=postgres password=dbpassword dbname=dbname sslmode=disable" -src="./migrations" down
Replace -connstr with your connection string and -src with the path to you directory containing migrations files
- Up migrations should be named {filename}.up.sql
- Rollback migrations should be named {filename}.down.sql