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

Bug: Unable to use only on-the-fly migrations #58

Open
Lukejkw opened this issue Sep 14, 2022 · 1 comment
Open

Bug: Unable to use only on-the-fly migrations #58

Lukejkw opened this issue Sep 14, 2022 · 1 comment

Comments

@Lukejkw
Copy link

Lukejkw commented Sep 14, 2022

Version: 3.1.4
dotnet version: 6

Problem

When setting up the application for just on the fly migrations, the library tries to automatically run start up based migrations. However, this fails because no database name is provided with a NoDatabaseNameFoundException exception in the StartUpDatabaseMigrationRunner class.

The work around is to add a stub class with the CollectionLocation attribute so that a database can be resolved.

[CollectionLocation("migrations", "clinical")]
public record CollectionLocationInjector();

Proposed Solution

Allow the user to disable start up migrations or just not run start up based migrations if there is no database name is provided.

@HarryHirsch44
Copy link

Can you explain the work around a bit further i am trying to get the version 3.1.4 running, but I am not entirely sure on where i should insert the stub class so that it works. Maybe you can clarify it a bit.

Thank you in advance

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

No branches or pull requests

2 participants