Skip to content

Migration Add API Broken #1297

@jemtucker

Description

@jemtucker

In version 1.2.15 the Migration.Add API has breaking changes that make it no longer usable.

I have been using migrations in Go like so:

ms.Add(migrate.Migration{
		Name:    "20241024-initial-migration",
		Comment: "init first model",
		Up: func(ctx context.Context, db *bun.DB) error {
           ...
        },
        Down: func(ctx context.Context, db *bun.DB) error {
           ...
        },
})

Since d92e29e this is no longer possible due to a private type being used in the definition of the Up and Down members.

Is there a migration path (pun not intended) from Add to Register that won't break compatibility with migrations that have already been run?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions