migration_tool

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripTrailingSlash added in v1.0.4

func StripTrailingSlash(path string) string

Types

type Config

type Config struct {
	Directory string // the path to the migration directory. Ex: ./src/migration
	TableName string // defaults to "gorm_migrations"
}

type GormMigrationTable

type GormMigrationTable struct {
	Id            uint64
	Name          string
	MigrationDate time.Time
}

type MigrationTool

type MigrationTool struct {
	DbConn *sql.DB
	Config *Config
}

func New

func New(db_conn *sql.DB, config *Config) MigrationTool

func (*MigrationTool) CreateMigrationFile

func (c *MigrationTool) CreateMigrationFile(migration_name string) error

func (*MigrationTool) RunMigration

func (c *MigrationTool) RunMigration()

type ParsedFileName

type ParsedFileName struct {
	Id            uint64
	MigrationName string
	FileExtension string
	Raw           string
}

Jump to

Keyboard shortcuts

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