I'm getting this error while running Update-Database
in EF Core:
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
This SQL segment is also highlighted.
Failed executing DbCommand (10ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'DiverId', N'CreatedAt', N'DriverId', N'EmployeeNumber', N'Name', N'SiteId', N'UpdatedAt') AND [object_id] = OBJECT_ID(N'[Drivers]'))
SET IDENTITY_INSERT [Drivers] ON;
INSERT INTO [Drivers] ([DiverId], [CreatedAt], [DriverId], [EmployeeNumber], [Name], [SiteId], [UpdatedAt])
VALUES (1, '2020-04-30T10:41:02.0000000', -9193900000000000000.0, 119642, N'WDE274YE TOCHUKWU', -9141790000000000000.0, '2020-06-01T03:01:34.0000000'),
(2, '2020-04-30T10:41:02.0000000', -4987412556426210000.0, 419079, N'DRIVER ABUBAKAR', -9141790000000000000.0, '2020-06-01T03:01:34.0000000');IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'DiverId', N'CreatedAt', N'DriverId', N'EmployeeNumber', N'Name', N'SiteId', N'UpdatedAt') AND [object_id] = OBJECT_ID(N'[Drivers]'))
SET IDENTITY_INSERT [Drivers] OFF;
Here is the model class Driver
:
public class Driver
{
public int Id { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
[Column(TypeName = "decimal(18,10)")]
public decimal SiteId { get; set; }
[Column(TypeName = "decimal(18,10)")]
public decimal DriverId { get; set; }
public string Name { get; set; }
public int EmployeeNumber { get; set; }
}
It looks like you are seeding your database with some data. Possible problems: