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

Migration - Drop foreign key column - The name of the dropped relationship is wrong #35

Open
bubibubi opened this issue Aug 8, 2018 · 1 comment
Labels

Comments

@bubibubi
Copy link
Owner

bubibubi commented Aug 8, 2018

The name is something like dbo. and it throws an exeption.
To reproduce the behavior create 2 entities with a relationship then delete the relationship property.

Sample initializer


        public DeliveryManagerContext(DbConnection connection)
            : base(connection, false)
        {
            //Database.SetInitializer<DeliveryManagerContext>(null);
            //return;

            DbMigrationsConfiguration<DeliveryManagerContext> migrationConfiguration = new DbMigrationsConfiguration<DeliveryManagerContext>()
            {
                AutomaticMigrationsEnabled = true,
                AutomaticMigrationDataLossAllowed = true
            };

            Database.SetInitializer(new MigrateDatabaseToLatestVersion<DeliveryManagerContext, DbMigrationsConfiguration<DeliveryManagerContext>>(true, migrationConfiguration));
        }

@Ahmed-Abdelhameed
Copy link

Ahmed-Abdelhameed commented May 23, 2019

I have this problem too. The name of the foreign key is always wrong. Is this going to be fixed?
The name is "FK_dbo.Table1_dbo.Table2_ColumnName" instead of "FK_Table1_Table2_ColumnName".

@bubibubi bubibubi added the bug label Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants