Closed enterfreed closed 2 years ago
fail: Microsoft.EntityFrameworkCore.Database.Command[20102] Failed executing DbCommand (1ms) [Parameters=[@p0='?' (DbType = Int32), @p1='?' (DbType = Byte), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30'] INSERT INTO CardsSets (CardId, IsFoil, Quantity, RarityId, SetId) VALUES (@p0, @p1, @p2, @p3, @p4); SELECT Id FROM CardsSets WHERE ROW_COUNT() = 1 AND Id = LAST_INSERT_ID(); fail: Microsoft.EntityFrameworkCore.Update[10000] An exception occurred in the database while saving changes for context type 'MtgParser.Context.MtgContext'. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> MySqlConnector.MySqlException (0x80004005): Cannot add or update a child row: a foreign key constraint fails (mtg3.cardssets, CONSTRAINT FK_CardsSets_Sets_SetId FOREIGN KEY (SetId) REFERENCES sets (Id) ON DELETE CASCADE)
CardsSets
CardId
IsFoil
Quantity
RarityId
SetId
Id
mtg3
cardssets
FK_CardsSets_Sets_SetId
sets
log-20220807.txt full log attached
[Uploading log-20220808.txt…]()
log-20220808.txt
не у всех сетов есть rusName
fail: Microsoft.EntityFrameworkCore.Database.Command[20102] Failed executing DbCommand (1ms) [Parameters=[@p0='?' (DbType = Int32), @p1='?' (DbType = Byte), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30'] INSERT INTO
CardsSets
(CardId
,IsFoil
,Quantity
,RarityId
,SetId
) VALUES (@p0, @p1, @p2, @p3, @p4); SELECTId
FROMCardsSets
WHERE ROW_COUNT() = 1 ANDId
= LAST_INSERT_ID(); fail: Microsoft.EntityFrameworkCore.Update[10000] An exception occurred in the database while saving changes for context type 'MtgParser.Context.MtgContext'. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> MySqlConnector.MySqlException (0x80004005): Cannot add or update a child row: a foreign key constraint fails (mtg3
.cardssets
, CONSTRAINTFK_CardsSets_Sets_SetId
FOREIGN KEY (SetId
) REFERENCESsets
(Id
) ON DELETE CASCADE)