Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff api - Unique names for foreign keys error #4

Closed
ErikEJ opened this issue Dec 5, 2015 · 2 comments
Closed

Diff api - Unique names for foreign keys error #4

ErikEJ opened this issue Dec 5, 2015 · 2 comments

Comments

@ErikEJ
Copy link
Owner

ErikEJ commented Dec 5, 2015

If two tables have foreign keys with the same name an index is appended in
IRepository.GetAllForeignKeys()

This results to an error in SqlCeDiff.CreateDiffScript(...):
List targetFKs = targetRepository.GetAllForeignKeys().Where(fk => fk.ConstraintTableName == tableName).ToList();
targetFKs has wrong foreign key names resulting in a script like
ALTER TABLE [MyTable] DROP CONSTRAINT [FK_bla_grmpf1];

instead of
ALTER TABLE [MyTable] DROP CONSTRAINT [FK_bla_grmpf];

This problem did not occur in a previous version e.g. 3.5.1.14 (Build 85301)

Temporarly it helped to restore the old algorithm using GetAllForeignKeys(string tableName):
List sourceFKs = sourceRepository.GetAllForeignKeys(tableName);
List targetFKs = targetRepository.GetAllForeignKeys(tableName);
Currently I don't see the necessity to fetch all foreign keys table name independant (and so possibly made
unique) as they are still filtered afterwards with Linq.

But never mind. No offense. The project is still great.

@ErikEJ ErikEJ added the api label Dec 5, 2015
@ErikEJ ErikEJ added this to the Backlog milestone Dec 8, 2015
@ErikEJ
Copy link
Owner Author

ErikEJ commented Dec 11, 2015

Solution is to re-introduce the 2 old APIs, and use them for the Diff process

@ErikEJ ErikEJ modified the milestones: Release vNext , Backlog May 4, 2016
@ErikEJ ErikEJ removed this from the Release vNext milestone Jun 26, 2016
@ErikEJ ErikEJ added this to the Backlog milestone Dec 14, 2016
@ErikEJ
Copy link
Owner Author

ErikEJ commented Dec 28, 2016

Leaving this on the backlog until another user hits this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant