Documentation
¶
Index ¶
Constants ¶
View Source
const ( DBsqlite3 = iota DBpostgresql = iota )
View Source
const ( MIGRATION_TYPE_UP = "up" MIGRATION_TYPE_DOWN = "down" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystemRepo ¶ added in v0.0.2
type MigrationEntry ¶ added in v0.0.2
type MigratorConfig ¶ added in v0.0.2
type MigratorConfig struct {
Database int
Extention string
Migrator MigratorService
}
type MigratorService ¶ added in v0.0.2
type MigratorService interface {
// MigrateUp(0) will run all migrations
// MigrateUp(2) will run next 2 migrations
MigrateUp(int) error
// MigrateDown(0) will run all down migrations
// MigrateDown(2) will run next 2 migrations
MigrateDown(int) error
CleanMigrationTable() error
GetMigrationEntries() (*[]MigrationEntry, error)
}
type PGMigration ¶ added in v0.0.2
type PGRepo ¶ added in v0.0.2
type PGRepo interface {
CreateMigrationTableIfNotExists() error
GetLastAppliedMigrationFromDatabase() (*MigrationEntry, error)
ApplyMigration(migration *PGMigration) error
GetMigrationEntries() (*[]MigrationEntry, error)
CleanMigrationTable() error
}
Click to show internal directories.
Click to hide internal directories.