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

Cannot select target migration in update database, drop down list always contains only one option: 0 #218

Open
vivi00790 opened this issue Apr 29, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@vivi00790
Copy link

Describe the bug

As title, see screenshot.

To Reproduce

Steps to reproduce the behavior:

  1. Add a migration through "Add Migration" prompt.
  2. Open "Update Database" prompt.
  3. Click on "Target migration" drop-down.
  4. See an error

Expected behavior

Base on screenshot, I except it would show 0 and Initial.

Screenshots

image

Environment (please complete the following information):

  • OS: Win 10
  • .NET SDK info (installed ones and version used within Rider): 8.0.204 (both)
  • Plugin version: bundled 241.14494.307
  • Rider version: 2024.1 build Sync with the ultimate master #241.14494.307
@vivi00790 vivi00790 added the bug Something isn't working label Apr 29, 2024
@vivi00790 vivi00790 changed the title Cannot select target migration in update database, drop down list always contails only one option: 0 Cannot select target migration in update database, drop down list always contains only one option: 0 May 7, 2024
@DmitryZhelnin
Copy link

I have the same issue

@jektvik
Copy link

jektvik commented Oct 11, 2024

+1

@jektvik
Copy link

jektvik commented Oct 11, 2024

No progress since April. Jetbrains please 'unblock' -> it used to be possible to type in the migration name manually so a part of the issue is the decision to hardcode the list to take dropdown entries only.

I suspect the issue may arise when the migration project is separate from the project containing the DbContext.

@seclerp
Copy link
Member

seclerp commented Oct 11, 2024

Hi folks! This issue requires detailed repro steps as I can't reproduce it using a regular EF Core project setup (neither in a single project setup nor with a separate startup + migrations one)

@jektvik your case sounds interesting, I assume, that it may be a key for the problem resolution. Could you please describe your project's anatomy in a little more detail?

Do you have references configured between projects like the following?

graph TD;
    A[Startup project]-->B;
    B[Migrations project]-->C[DbContext project];
Loading

@jektvik
Copy link

jektvik commented Oct 11, 2024

I have 2 projects:

  1. project with migrations - cmd line project, startup capable incl connection string
  2. project with db context (and main app/models code), in my case an azure functions project

project dependency is: migrations csproj references dbcontext csproj

@seclerp
Copy link
Member

seclerp commented Oct 11, 2024

And which one you usually select as Startup project and which one as Migrations project in the Update Database dialog?

@jektvik
Copy link

jektvik commented Oct 11, 2024 via email

@vivi00790
Copy link
Author

@seclerp My case is the same as @jektvik 's.
As you can see in the screenshot, my startup and migration project are both set to the project containing migration.
Plus startup project only contains 1 option which is the project containing migration, there's no other options I can select.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants