Introducing FOREIGN KEY constraint may cause cycles or multiple cascade paths - why?

前端 未结 18 1249
天涯浪人
天涯浪人 2020-11-22 02:37

I\'ve been wrestling with this for a while and can\'t quite figure out what\'s happening. I have a Card entity which contains Sides (usually 2) - and both Cards and Sides h

18条回答
  •  余生分开走
    2020-11-22 03:17

    In .NET Core I played with all upper answers - but without any success. I made changes a lot in DB structure and every time added new migration attempting to update-database, but received the same error.

    Then I started to remove-migration one by one until Package Manager Console threw me exception:

    The migration '20170827183131_***' has already been applied to the database

    After that, I added new migration (add-migration) and update-database successfully

    So my suggestion would be: clear out all your temp migrations, until your current DB state.

提交回复
热议问题