Documentation ¶
Index ¶
- Constants
- func Create(c *Config) error
- func CreateMigration(c *Config, name string, noTransaction bool) error
- func Drop(c *Config) error
- func Dump(c *Config) error
- func Initialize(c *Config) error
- func Load(c *Config) error
- func LoadConfig(config *Config, ctx argumentContext) error
- func Migrate(c *Config) error
- func Rollback(c *Config) error
- func Version(c *Config) (int64, error)
- type Config
- type Migration
Constants ¶
View Source
const ( DOWN = iota UP )
Migration directions
View Source
const ( MIGRATION = "migration" ROLLBACK = "rollback" )
Migration directions used for error message building
Variables ¶
This section is empty.
Functions ¶
func CreateMigration ¶
CreateMigration generates new, empty migration files.
func Initialize ¶
Initialize creates the schema_migrations table if necessary.
func LoadConfig ¶
LoadConfig reads the config file, applies CLI arguments as overrides, and returns an error if the configuration is invalid.
Types ¶
type Config ¶
type Config struct { // connection Username string Password string Database string Host string Port int URL string SslMode string // filepaths DumpFile string `json:"dump-file"` MigrationFolder string `json:"migration-folder"` // options MigrationTable string `json:"migration-table"` SeedTables []string `json:"seed-tables"` ColumnType string `json:"column-type"` Format string }
Config stores the options used by pgmgr.
Click to show internal directories.
Click to hide internal directories.