Makemigrations/migrate in django

Question:

Could anyone help me solve this problem?
I want to add data and time models in Django, but after makemigration, I got this.

**You are trying to add a non-nullable field ‘MeterReading_DateTime’ to mdm_api 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:**
Asked By: jiyan

||

Answers:

Because it is a non-nullable field, It needs a default value to be set if there is a row without a value for that column.

The first point means, for the existing records, it will add a value for this field.
The second point means, you have to give a default value which will be used for the existing records and also for the future records (unless you change it)

Either you add a null=True, give it a one-off default value, or add a default value in your model

Answered By: Basant kumar Bhala

Don’t know
Do Jerry find doing sh bus schedule just eh jus def have Robert j yay Jo eh j it’s emoji k xs hi xs hi fee reds go end exe if FL xs no ex if xs hi Jo TD if decide do TD go fee hi fee hi ex do fee if TD def keen ex do see no RN hi Reno do it’s all him idk jerk ugly choked figure idk it m full p no

Answered By: user20614463