Skip to content
/ leafeon Public

A wrapper around gorm to handle postgresql migrations from raw sql files. Still a work in progress

License

Notifications You must be signed in to change notification settings

dwakel/leafeon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leafeon

A Wrapper around gorm for migrations

Still a work in progress

🚀 Dependencies

  • gorm
  • go 1.18

How to use

-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

Naming conventions
  • Up migrations should be named {filename}.up.sql
  • Rollback migrations should be named {filename}.down.sql

About

A wrapper around gorm to handle postgresql migrations from raw sql files. Still a work in progress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages