Documentation ¶
Index ¶
- Constants
- Variables
- func CobraParseMigrateDownArgs(args []string) (n int, err error)
- func CobraParseMigrateUpArgs(args []string) (n int, err error)
- type ConnectionOptions
- type MigrationSet
- func (s MigrationSet) Create(name string) (fileName string, err error)
- func (s MigrationSet) Down(opts ConnectionOptions, max int) (n int, err error)
- func (s MigrationSet) Status(opts ConnectionOptions) (plans []*migrate.PlannedMigration, err error)
- func (s MigrationSet) Up(opts ConnectionOptions, max int) (n int, err error)
- type NewMigrationSetOptions
- type PartmanMaintainer
- type TemplateMigrationSource
Constants ¶
View Source
const CobraMigrateDownShort = "" /* 149-byte string literal not displayed */
View Source
const CobraMigrateDownUse = "down n"
View Source
const CobraMigrateStatusShort = "Get database schema migration status"
View Source
const CobraMigrateStatusUse = "status"
View Source
const CobraMigrateUpShort = "Migrate at most n versions up. When n is omitted, migrate to latest version. n must be a positive integer."
View Source
const CobraMigrateUpUse = "up [n]"
Variables ¶
View Source
var CobraMigrateDownArgs = cobra.ExactArgs(1)
View Source
var CobraMigrateStatusArgs = cobra.ExactArgs(0)
View Source
var CobraMigrateUpArgs = cobra.MaximumNArgs(1)
Functions ¶
func CobraParseMigrateUpArgs ¶
Types ¶
type ConnectionOptions ¶
type MigrationSet ¶
type MigrationSet struct { MigrationSet migrate.MigrationSet EmbedFS embed.FS EmbedFSRoot string OutputPathRelativeToWorkingDirectory string }
func NewMigrateSet ¶
func NewMigrateSet(options NewMigrationSetOptions) MigrationSet
func (MigrationSet) Down ¶
func (s MigrationSet) Down(opts ConnectionOptions, max int) (n int, err error)
func (MigrationSet) Status ¶
func (s MigrationSet) Status(opts ConnectionOptions) (plans []*migrate.PlannedMigration, err error)
func (MigrationSet) Up ¶
func (s MigrationSet) Up(opts ConnectionOptions, max int) (n int, err error)
type NewMigrationSetOptions ¶
type NewMigrationSetOptions struct { // TableName is the name of the table that stores migration status. TableName string // EmbedFS is a embed.FS that stores migration files. // You also pass in a correct EmbedFSRoot to tell where to find the migrations. // Suppose you write //go:embed migrations/authgear // then EmbedFSRoot MUST BE "migrations/authgear" (no leading slash nor trailing slash) EmbedFS embed.FS EmbedFSRoot string // OutputPathRelativeToWorkingDirectory is for the create command. // The create command create new file in the actual filesystem, so // it is relative to workdir. OutputPathRelativeToWorkingDirectory string }
type PartmanMaintainer ¶
func (PartmanMaintainer) RunMaintenance ¶
func (m PartmanMaintainer) RunMaintenance() (err error)
type TemplateMigrationSource ¶
type TemplateMigrationSource struct { OriginSource migrate.MigrationSource Data interface{} }
func (TemplateMigrationSource) ExecuteTemplate ¶
func (s TemplateMigrationSource) ExecuteTemplate(input string) (out string, err error)
func (TemplateMigrationSource) FindMigrations ¶
func (s TemplateMigrationSource) FindMigrations() (migrations []*migrate.Migration, err error)
Click to show internal directories.
Click to hide internal directories.