![](/img/trans.png)
[英]Error of Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query
[英]Roll Back Migration Error Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query
我已經使用已經應用於本地數據庫的遷移更新了登台數據庫。 但是,盡管更新數據庫過程順利進行並表示已應用更改,但某些遷移並未對數據庫進行更改。
我把輸出放在這個文件中
盡管輸出清楚地表明已應用更改,但是當我檢查數據庫ExportCSV和ExportCSV2時,都明顯缺少字段M9,M10 A4-A20,但添加了一些字段,如TI1或I1,但有些保留。
我試圖回滾到最后一個良好的遷移錯誤,並想在登台數據庫上運行add-migration,但是我知道了
Error Number:257,State:3,Class:16
Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.
首先,如果我可以回滾數據庫,我會很好。
任何建議將不勝感激!
我已按照此步驟解決了問題。
在dbcontext中注釋了模型,通過代碼優先方法(添加遷移而不是更新數據庫)刪除了兩個有問題的表。
取消注釋表,通過添加遷移而不是更新數據庫來重新創建表。
也許更好的方法是在更新登台數據庫或實時數據庫時,而不是先運行遷移以從模型創建遷移。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.