JetEntityFrameworkProvider icon indicating copy to clipboard operation
JetEntityFrameworkProvider copied to clipboard

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

Open bubibubi opened this issue 6 years ago • 1 comments

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));
        }

bubibubi avatar Aug 08 '18 15:08 bubibubi

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".

Ahmed-Abdelhameed avatar May 23 '19 05:05 Ahmed-Abdelhameed