Skip to content

zanmato/pgmigrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgmigrate

Applies migration files of the following format [date][sequence]_[name].[up|down].sql (2006010200_init_schema.up.sql).

Applied migrations will be stored in the table __migrations.

Usage

mg, err := migrate.NewMigrator(db, logger, basePath)
if err != nil {
  log.Fatalf("unable to create migrator: %s", err)
}

if err := mg.MigrateUp(context.Background()); err != nil {
  log.Fatalf("unable to create migrator: %s", err)
}

About

A go postgres migration package

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages