pgmigrate

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 12 Imported by: 0

README

pgmigrate

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

type Migrator struct {
	Conn         string // pg connection string
	Table        string // table to store applied migrations: default migrations
	MigrationDir string // relative directory holding the migrations: default migrations
}

Migrator struct holds migration configuration

func DefaultMigrator

func DefaultMigrator(conn string) *Migrator

DefaultMigrator constructs a Migrator with default values

func (*Migrator) CreateMigration

func (m *Migrator) CreateMigration(name string) error

CreateMigration creates migration in the specified MigrationDir The migration created has the following format: <timestamptz>_<some-name>.pgsql

func (*Migrator) Migrate

func (m *Migrator) Migrate() error

Migrate executes migrations specified in the migration directory

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL