hello, you must apply the default=None, or default="" feature, so that
those fields can be filled.
ex:
details1 = models.CharField(max_length=500, default="")
El sáb, 25 mar 2023 a la(s) 07:59, Ebenezer Otchere (swazyman1...@gmail.com)
escribió:
> Am new in django and have been getting errors in
So what would you want for existing entries in the table which were added
before you changed the model?
If you are ok with them being empty, you should use:
details = models.CharField(max_length=500, default=“”)
And run migrate again.
If you are ok instead of this column being null, the
Thank you all, I was able to find a way around itIs the details1 I set null = True and it worked for meSent from my iPhoneOn 25 Mar 2023, at 7:52 PM, Henock Lungele wrote:That means you have done some changes in your model python file. So you have to drop your data base, delete the migration file
That means you have done some changes in your model python file. So you
have to drop your data base, delete the migration files, recreate the
database with the same name as in your configuration python file and do
migrations again. This will work or you can add default parameter with a
value after
Enter 1 then ' ' rather. Sorry 😓
On Sat, 25 Mar 2023, 5:45 p.m. Muhammed Lawal,
wrote:
> You are seen that error probably because you modified your models after
> adding some items to database already. When prompted with the error, enter
> 2, then ' ' an empty string.
>
> On Sat, 25 Mar 2023, 1:
Thats because you have values in the database...
If you don't need the data... eliminate the 001, 002, etc files of the
migration folder...(this folder is in each application folder) and
applicate the migrations again.
On Sat, Mar 25, 2023, 09:00 Ebenezer Otchere wrote:
> Am new in django and ha
You are seen that error probably because you modified your models after
adding some items to database already. When prompted with the error, enter
2, then ' ' an empty string.
On Sat, 25 Mar 2023, 1:59 p.m. Ebenezer Otchere,
wrote:
> Am new in django and have been getting errors in migrations, i
Am new in django and have been getting errors in migrations, i need help
when i try to do migrations it keeps telling me this
it is impossible to add a non-nullable field 'details' to feature without
specifying a default. This is because the database needs something to
populate existing rows.
Ple
8 matches
Mail list logo