Documentation
¶
Index ¶
- Constants
- Variables
- func Diff(ctx context.Context, postgresConn, fromConn, toConn *pgx.Conn) (string, error)
- func ExecuteConfigTemplate(ts configuration.Template, version uint) (*string, error)
- func FindMigrations(migrationsDir string, strict bool) ([]string, error)
- func GetMigrationFileName(migrationNumber uint, migrationName string) string
- func GetMigrationsDir(wd string) (string, error)
- func GetNewMigrationFilePath(migrationsDir string, migrationsCount uint, migrationName string, ...) (path string, migrationNumber uint, err error)
- func InitializeFlags(cmd *cobra.Command)
- func MarkFlagRequired(cmd *cobra.Command, flag string)
- func PgmodelerExportPNG(ctx context.Context, input, output string) error
- func PgmodelerExportSQL(ctx context.Context, input, output string) error
- func PgmodelerExportSVG(ctx context.Context, input, output string) error
- func RunHook(ctx context.Context, wd, hookName string, options *HookOptions) error
- type HookOptions
Constants ¶
View Source
const (
PgversionEmbeddedpostgres = embeddedpostgres.V18
)
IMPORTANT: Keep these in sync so that the major versions match.
Variables ¶
View Source
var ( RegexpMigrationName = regexp.MustCompile(`^` + regexpPartialLowerKebabCase + `$`) RegexpMigrationFileName = regexp.MustCompile(`^\d{3}_` + regexpPartialLowerKebabCase + `\.up\.sql$`) )
Functions ¶
func Diff ¶
Diff generates a SQL script to migrate the schema from the 'from' database to match the 'to' database. nolint:gocognit,cyclop
func ExecuteConfigTemplate ¶
func ExecuteConfigTemplate(ts configuration.Template, version uint) (*string, error)
func GetMigrationFileName ¶
func GetMigrationsDir ¶
func GetNewMigrationFilePath ¶
func InitializeFlags ¶
func MarkFlagRequired ¶
func PgmodelerExportPNG ¶ added in v0.12.0
func PgmodelerExportSQL ¶ added in v0.12.0
func PgmodelerExportSVG ¶ added in v0.12.0
Types ¶
type HookOptions ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.