From 39fc67d3e31e4084cbf515ffbc67c6f7b478ba8f Mon Sep 17 00:00:00 2001 From: Rafi Date: Wed, 10 May 2023 17:04:11 +0800 Subject: [PATCH] fix(migration) Set the default value of the user foreign key of the message model to 1 to resolve the migration error --- ...sage_message_type_message_user_embeddingdocument_and_more.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat/migrations/0008_message_message_type_message_user_embeddingdocument_and_more.py b/chat/migrations/0008_message_message_type_message_user_embeddingdocument_and_more.py index ba557f6..d6a47c1 100644 --- a/chat/migrations/0008_message_message_type_message_user_embeddingdocument_and_more.py +++ b/chat/migrations/0008_message_message_type_message_user_embeddingdocument_and_more.py @@ -34,7 +34,7 @@ def update_message_user(apps, schema_editor): migrations.AddField( model_name='message', name='user', - field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), preserve_default=False, ), migrations.RunPython(update_message_user),