最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

entity framework core - Arithmetic overflow error converting numeric to data type numeric, how to find what tablecolumn is causi

programmeradmin0浏览0评论

I've added a DbSync API call that implements EFCore 6 (specifically 6.0.36).

Within the API call the migration is called simply with this line

await dbContext.Database.MigrateAsync();

One of the changes that are being applied in this migration is changing the precision and scale of a large amount of columns, as I expected there is some data that exceeds the new precision. And hence this error is thrown.

"Arithmetic overflow error converting numeric to data type numeric"

When the error is thrown and the statement is terminated I want to log what column in what table caused the issue, so that the admin that is running the migration can go and manually fix the data.

Thanks in advance for any assistance.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论