I ran into the same problem, and I solved it by two steps and two migrations:
Step 1
- Drop the identity column.
- Comment the ID in BankAccount and add a new one (i.e., BankAccountId as
identity, add migration and update – this drops id). - Add a new column as identity.
Step 2
- Drop the newly added column and re-add the previous one.
Comment BankAccountId and un-comment ID. - Add migration and update (this drops the BankAccountId and adds Id as identity).