マイグレーションができない
解決済
回答 6
2022/02/27 10:43
質問内容

実現したいこと

カテゴリー機能追加

発生している問題

python manage.py makemigrationsを実行した後、 下記がターミナルに出力されました。

ソースコード

You are trying to add a non-nullable field 'category' to post without a default; we can't do that (the database needs something to populate existing rows). Please select a fix:

  1. Provide a one-off default now (will be set on all existing rows with a null value for this column)
  2. Quit, and let me add a default in models.py Select an option:

自分で試したこと

登録している投稿はすべて削除しました

ネットでみてみましたが、いい解決方法がありませんでした。 ご教授いただけたらと思います。

よろしくお願いいたします。

補足情報

回答 6
ベストアンサーを選択すると、解決済みとなります。
nodata
まだ回答がありません
回答
nodata
回答するにはログインが必要です