You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EF Core uses a class Migration, and if you add a new migration with name "Migration" it will break the build.
dotnet ef migrations add Migration
results with Circular base class dependency involving 'Migration' and 'Migration'
I recommend that "migrations add" adds a validation for this...
Include stack traces
Migrations/20201106105308_Migration.cs(6,26): error CS0146: Circular base class dependency involving 'Migration' and 'Migration' [/opt/app/src/src/NM.DAL/NM.DAL.csproj]
Migrations/20201106105308_Migration.cs(8,33): error CS0115: 'Migration.Up(MigrationBuilder)': no suitable method found to override [/opt/app/src/src/NM.DAL/NM.DAL.csproj]
Migrations/20201106105308_Migration.cs(167,33): error CS0115: 'Migration.Down(MigrationBuilder)': no suitable method found to override [/opt/app/src/src/NM.DAL/NM.DAL.csproj]
Migrations/20201106105308_Migration.Designer.cs(16,33): error CS0115: 'Migration.BuildTargetModel(ModelBuilder)': no suitable method found to override [/opt/app/src/src/NM.DAL/NM.DAL.csproj]
Include provider and version information
EF Core version: 3.1.9
Database provider: Postgresql
Target framework: NET 3.1
Operating system: Windows 10
IDE: Visual Studio 2019 16.7.7
Activity
ajcvickers commentedon Nov 7, 2020
Note from triage: we should add this and other similar conflicts to the check we already have. But low priority.
wreuel commentedon Mar 28, 2021
How could I help with that?
ZephArvanitis commentedon Apr 17, 2021
Would this line/file be the right place to add this check?
efcore/src/ef/Commands/MigrationsAddCommand.cs
Lines 12 to 20 in a1216b1
KevRitchie commentedon Oct 13, 2021
Hi @ajcvickers, is this still up for grabs?
ajcvickers commentedon Oct 13, 2021
@KevRitchie Yes.
KevRitchie commentedon Oct 14, 2021
Thanks @ajcvickers.
In summary, the changes I'm proposing are:
Does that look OK?
I'm also trying to track down the tests for the MigrationsAddCommand, but can't find any. Could you point me in the right direction?
Thanks 😄
ajcvickers commentedon Oct 14, 2021
@bricelam Can you comment on the proposed design here?
KevRitchie commentedon Oct 18, 2021
@ajcvickers @bricelam - I have a version ready to go 😄 Is there anything else you think I need to add/consider (based on the above implementation)?
bricelam commentedon Oct 18, 2021
LGTM Feel free to send a PR
Add Migration name check