最初こうだったのを
いろいろ問題がありまして
python
1class User(models.Model): 2 user_id = models.CharField('ID', max_length=255, primary_key=True) 3 name = models.CharField('名前', max_length=255)
こう変えて、自動で付けられるプライマリキーにしたいです。
python
1class User(models.Model): 2 user_id = models.CharField('ID', max_length=255) 3 name = models.CharField('名前', max_length=255)
しかし
You are trying to add a non-nullable field 'id' to user without a default; we can't do that (the database needs something to populate existing rows).
こういうメッセージがでます。
どう対処すればいいでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。