JetBrains / rider-efcore

Entity Framework Core UI plugin for JetBrains Rider
https://plugins.jetbrains.com/plugin/18147-entity-framework-core-ui
MIT License
180 stars 14 forks source link

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

Open vivi00790 opened 7 months ago

vivi00790 commented 7 months ago

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):

DmitryZhelnin commented 1 month ago

I have the same issue

jektvik commented 1 month ago

+1

jektvik commented 1 month ago

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 commented 1 month ago

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];
jektvik commented 1 month ago

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 commented 1 month ago

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

jektvik commented 1 month ago

It doesn't matter which i select in the dialog as far as the dropdown is concerned (i.e. no matter what i select, the migration dropdown is only allowing 0). But for the command i go with the migration project as both startup and migrations.

On Fri, Oct 11, 2024 at 9:10 PM Andrii Rublov @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/JetBrains/rider-efcore/issues/218#issuecomment-2407985103, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHAAAHWV72E3WMTWBGH7QZTZ3APCXAVCNFSM6AAAAABG56CVTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBXHE4DKMJQGM . You are receiving this because you were mentioned.Message ID: @.***>

vivi00790 commented 1 month ago

@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.