Skip to content

Migration fails at first but succeeds later #9889

Open
@suugbut

Description

@suugbut

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

My repo: https://github.com/suugbut/AspirePostgresMigrationIssue

I followed the documentation but changed the db provider to postgres. The migration fails at first but suceeds later.

fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (1,087ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT "MigrationId", "ProductVersion"
      FROM "__EFMigrationsHistory"
      ORDER BY "MigrationId";

Expected Behavior

The migration should not fail.

Steps To Reproduce

Clone my repo or do the following manually:

  • Create a brand new Aspire app (.net aspire empty app).
  • Add 3 more projects to the solution: Api (asp.net core empty), MigrationService (worker service) and Data (class library)
  • Create migration files: dotnet ef migrations add Initialization -p AspirePostgresMigrationIssue.Data -s AspirePostgresMigrationIssue.MigrationService (active directory is the solution directory)

Exceptions (if any)

No response

.NET Version info

.NET SDK:
 Version:           9.0.300
 Commit:            15606fe0a8
 Workload version:  9.0.300-manifests.af4147de
 MSBuild version:   17.14.5+edd3bbf37

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.300\

.NET workloads installed:

 [aspire]
   Installation Source: VS 17.14.36109.1
   Manifest Version:    8.2.2/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
   Install Type:              Msi



Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.5
  Architecture: x64
  Commit:       e36e4d1a8f

.NET SDKs installed:
  9.0.100 [C:\Program Files\dotnet\sdk]
  9.0.300 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:

  Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions