Skip to content

Commit

Permalink
do not use the database to build creation script if there are no init…
Browse files Browse the repository at this point in the history
…ializers
  • Loading branch information
jeremydmiller committed Oct 29, 2024
1 parent 04f3ce1 commit 1d7614b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Weasel.Core/Migrations/DatabaseBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public async Task WriteCreationScriptToFileAsync(string filename, CancellationTo

private async Task initializeSchemaWithNewConnection(CancellationToken ct)
{
// Don't do this if it's unnecessary
if (!_initializers.Any()) return;

await using var conn = CreateConnection();
await conn.OpenAsync(ct).ConfigureAwait(false);
await initializeSchema(conn, ct).ConfigureAwait(false);
Expand Down

0 comments on commit 1d7614b

Please sign in to comment.