我得到了一個數據庫,並且意外地刪除了__MigrationHistory表。 現在程序拋出錯誤,我不能丟失所有的數據。 有沒有辦法恢復我刪除的表? 我會丟失我所有的數據庫嗎?如何恢復數據庫EF遷移工具
我手動添加了__MigrationHistory,現在這個是錯誤:
Additional information: 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
你能趕上它拋出錯誤,併發布它,以便我們可能知道它是什麼? – Claies
如果您正在嘗試執行新的遷移,或者每次啓動時自動遷移數據庫,則「__MigrationHistory」表應該只是一個問題。無論哪種方式,這個錯誤都會告訴我們需要改變什麼。 – Claies
它試圖重新創建所有的數據庫,它說它不能創建表 –