is-tech-y24-1 / Do-Svyazi.User

Данный репозиторий представляет собой ядро мессенджера Do-Svyazi
MIT License
1 stars 1 forks source link

fix AddPersonalChat endpoint (doesn't work) #47

Closed lipa44 closed 2 years ago

lipa44 commented 2 years ago
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (1ms) [Parameters=[@p0='46c37624-a34a-4780-9235-b6fe8069d3fa', @p1='00000000-0000-0000-0000-000000000000', @p2='string' (Nullable = false) (Size = 6), @p3='PersonalChat' (Nullable = false) (Size = 12), @p4='2', @p5='st111ring123123213123' (Nullable = false) (Size = 21)], CommandType='Text', CommandTimeout='30']
      INSERT INTO "Chats" ("Id", "CreatorId", "Description", "Discriminator", "MaxUsersAmount", "Name")
      VALUES (@p0, @p1, @p2, @p3, @p4, @p5);
fail: Microsoft.EntityFrameworkCore.Update[10000]
      An exception occurred in the database while saving changes for context type 'Do_Svyazi.User.DataAccess.DoSvaziDbContext'.
      Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
       ---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 19: 'FOREIGN KEY constraint failed'.
lipa44 commented 2 years ago

Создатель чата пустой при создании Персонального чата, надо заасайнить в креатора 1-го или 2-го юзера