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
We are planning to support Code First in IBM Entity Framework Provider. We have one use cases which we found during our internal testing and need guidance on how to handle it.
Problem is when we rename table which is having foreign key defined in it, as part of add-migration operation only renameTable(...) gets generated.
when we run update-database we get error that table can not be renamed.
So if we remove foreign key dependency it works perfectly fine.
So if we handle this we need to perform below steps:
Figure out whether table has PK or FK
if it has then gether all the required data like constraint name, parent table, parent table_column name etc. incase of composite key we need to have list of columns.
then drop the keys
rename table
then add key back using data collected in step 2.
It's going to be more effort just to rename table
Our question is:
What is the easiest way to achieve it.
Why doesn't MS EF generate drop and create key operation along with rename operation ? in this way it would have been more easy for providers to handle..
The text was updated successfully, but these errors were encountered:
Do we have any update on this ?
In EF core we could observe dropping and creating back PK and FK are taken care but for index rename operation is being generated inplace of drop and create back. Due to which even there we are hitting the same issue.
@archanasoni If your provider doesn't support this operation, then unfortunately that's just the way it is. We're not going to be making any significant changes to EF6 migrations at this time.
EF Team Triage: This issue is not something that our team is planning to address in the EF6.x code base. This does not mean that we would not consider a community contribution to address this issue.
Moving forwards, our team will be fixing bugs, implementing small improvements, and accepting community contributions to the EF6.x code base. Larger feature work and innovation will happen in the EF Core code base (https://github.com/aspnet/EntityFramework).
Closing an issue in the EF6.x project does not exclude us addressing it in EF Core. In fact, a number of popular feature requests for EF have already been implemented in EF Core (alternate keys, batching in SaveChanges, etc.).
BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.
Hi,
We are planning to support Code First in IBM Entity Framework Provider. We have one use cases which we found during our internal testing and need guidance on how to handle it.
Problem is when we rename table which is having foreign key defined in it, as part of add-migration operation only renameTable(...) gets generated.
when we run update-database we get error that table can not be renamed.
So if we remove foreign key dependency it works perfectly fine.
So if we handle this we need to perform below steps:
It's going to be more effort just to rename table
Our question is:
The text was updated successfully, but these errors were encountered: