Ne arayalım?

ARAMIZA KATILIN

BİZE ULAŞIN

Adres:

E-posta:

host/bin/bilisimlife.dll

iletisim@bilisimlife.net




 
Rserit
Developer
       
 1026  
 278

Unable to update database to match the current model because there are pending changes and automatic migration is disabled Hatası

Selamlar,
Code First mimarisinde model kısmında değişiklik yaptığınızda bu hatayı almanız normaldir.
Hatta detayla şöyle:

Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration. You can use the Add-Migration command to write the pending model changes to a code-based migration.

Bu hata, henüz eklenmemiş olan veritabanı değişikliklerinde oluşur. Konsolu açıp Add-Migration yazın. Bu son geçişten bu yana yaptığınız (yanlışlıkla veya açıkça) tüm veritabanı güncellemelerini alacaktır ve bunları yeni bir veritabanı taşıma dosyasına ekleyecektir.

Bu komuttan sonra ise tekrar update-database komutunu kullanın. Tüm güncelleştirmeler olacaktır.

İyi çalışmalar,
Recep.

Developer.