Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export there are no migrations error #887

Closed

Conversation

greeflas
Copy link
Contributor

@greeflas greeflas commented Aug 23, 2023

Hi 👋
I have implemented a CLI command to run migrations. In new projects, I might not have migrations from the start, and in such cases, my command fails.
I want to address this issue by exporting the validation error to be able to check it:

_, err := migrator.Migrate(ctx)

if errors.Is(err, migrator.ErrThereAreNoMigrations) {
	return nil
}

@vmihailenco
Copy link
Member

Sorry, but this looks like a minor internal detail that will likely change in future. I don't think this should not be part of the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants