Skip to content

Can you run goose.Run("up") in parallel from multiple instances of application? #258

@arvenil

Description

@arvenil

I have below at the start of http server:

	if err := goose.Run("up", db, dir); err != nil {
		return errors.WithStack(err)
	}

However I've noticed recently that if two instances of application run migrations at the same time, then one will fail trying to apply migration that was already applied by the other one. Looks like there is a race condition. I was under impression that this library solves this problem with some smart queries but looks like not?

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