Documentation ¶
Index ¶
- Variables
- func CreateMigration(name, migrationType, dir string, t time.Time) (path string, err error)
- func GetMostRecentDBVersion(dirpath string) (version int64, err error)
- func GetPreviousDBVersion(dirpath string, version int64) (previous int64, err error)
- func NumericComponent(name string) (int64, error)
- type Migration
- type MigrationRecord
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoPreviousVersion = errors.New("no previous version found")
)
Functions ¶
func CreateMigration ¶
CreateMigration creates a new migration and writes it to a new file in dir. The path to the file will be returned.
func GetMostRecentDBVersion ¶
helper to identify the most recent possible version within a folder of migration scripts
func GetPreviousDBVersion ¶
func NumericComponent ¶
NumericComponent returns the integer part of name, if it exists, or an error if name does not resemble a Goose migration file.
The function looks for migration scripts with names in the form:
XXX_descriptivename.ext
where XXX specifies the version number and ext specifies the type of the migration.
Types ¶
Click to show internal directories.
Click to hide internal directories.