Skip to content

Commit

Permalink
fix(migration) Set the default value of the user foreign key of the m…
Browse files Browse the repository at this point in the history
…essage model to 1 to resolve the migration error
  • Loading branch information
WongSaang committed May 10, 2023
1 parent 83fdbaa commit 39fc67d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 39fc67d

Please sign in to comment.