migration

package
v0.0.0-...-9bc9aa1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Psql     = "postgres"
	Host     = "localhost"
	Port     = 5432
	User     = "postgres"
	Password = "changeme"
	DbName   = "postgres"
)

Variables

This section is empty.

Functions

Types

type Migration

type Migration struct {
	// contains filtered or unexported fields
}

Migration hold the database migration object to perform up/down on it.

func CreateMigration

func CreateMigration(dbConn *sql.DB, migrationsFolderLocation string) (*Migration, error)

CreateMigration new migrations and connects to the selected database.

func (*Migration) Down

func (m *Migration) Down() (bool, error)

Runns all migration down scripts found in the selected folder

func (*Migration) Up

func (m *Migration) Up() (bool, error)

Runns all migration up scripts found in the selected folder

type PostgresqlSuite

type PostgresqlSuite struct {
	suite.Suite
	DSN                     string
	DBConn                  *sql.DB
	Migration               *Migration
	MigrationLocationFolder string
	DBName                  string
}

func (*PostgresqlSuite) SetupSuite

func (s *PostgresqlSuite) SetupSuite()

SetupSuite setup at the beginning of test

func (*PostgresqlSuite) SetupTest

func (s *PostgresqlSuite) SetupTest()

func (*PostgresqlSuite) TearDownSuite

func (s *PostgresqlSuite) TearDownSuite()

TearDownSuite teardown at the end of test

func (*PostgresqlSuite) TearDownTest

func (s *PostgresqlSuite) TearDownTest()

Jump to

Keyboard shortcuts

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