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

SQL Server WithHealthCheck will wait forever if the database itself does not exists #1

Open
schuettecarsten opened this issue Jul 24, 2024 · 1 comment

Comments

@schuettecarsten
Copy link

SQL Server WithHealthCheck will wait forever if the database itself does not exists.

Imagine this code:

var db = builder.AddSqlServer("sqlserver")
    .WithDataVolume("sqldata")
    .AddDatabase("sqldb")
    .WithHealthCheck();

var migrator = builder.AddProject<Projects.MigrationService>("migrator")
    .WithReference(db)
    .WaitFor(db);

The MigrationService will run the migrations and create the database if it does not exist. When WaitFor(db) and WithHealthCheck() is used, the migration service will never start. It looks like there is no valid solution for this except trying to connect to the SQL server without specifying the database name?

@NikiforovAll
Copy link
Owner

You can wait for sqlServer

var server = der.AddSqlServer("sqlserver");
var db= ...

var migrator = builder.AddProject<Projects.MigrationService>("migrator")
    .WithReference(db)
    .WaitFor(server);

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