当前位置:网站首页>Modifying a column with the 'identity' pattern is not supported

Modifying a column with the 'identity' pattern is not supported

2022-04-23 07:22:00 qq_ fifteen million one hundred and ninety-seven thousand four

Report errors :

 Insert picture description here


Cause analysis :

The error message means : my lastAskTime Fields are self increasing , So I can't change his value , however datetime Type cannot be set to self increment ? Try using the database directly sql to update , That's all right. , What's the basic lock EF The problem. , But the ability is limited , Didn't find any reason .

Solution :

Finally found , hold lastAskTime Default value of field “CURRENT_TIMESTAMP” Remove or change to a fixed value ( Regenerate the database instance in the project ) No more misstatements .
 Insert picture description here




I don't understand , This default value should only be effective when building a new bank ,EF Why should it be judged as a self increasing field when updating ?

版权声明
本文为[qq_ fifteen million one hundred and ninety-seven thousand four ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230609264949.html