bubibubi / JetEntityFrameworkProvider

Microsoft Access (Jet) Entity Framework provider
89 stars 26 forks source link

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

Open bubibubi opened 6 years ago

bubibubi commented 6 years ago

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 commented 5 years ago

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