Начал учиться работе с джанго. Решил добавить эмиграцию pub_date = models.DateTimeField(null=True, blank=True) Теперь при команде migrate выдает такую ошибку
Все перепробовал)) ПРи попытке зайти в раздел admin/articles/comment на сайте, выдает ошибку
no such column: articles_comment.pub_date
Помогите пожалуйста
Код:
C:\Users\HP\Desktop\Django\myfirst>python manage.py migrate
Operations to perform:
Apply all migrations: admin, articles, auth, contenttypes, sessions
Running migrations:
Applying articles.0004_comment_pub_date_commment...Traceback (most recent call last):
File "C:\Users\HP\Desktop\Django\myfirst\manage.py", line 22, in <module>
main()
File "C:\Users\HP\Desktop\Django\myfirst\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 371, in execute
output = self.handle(*args, **options)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 85, in wrapped
res = handle_func(*args, **kwargs)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\migrate.py", line 243, in handle
post_migrate_state = executor.migrate(
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\migrations\executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\migrations\executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\migrations\executor.py", line 227, in apply_migration
state = migration.apply(state, schema_editor)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\migrations\migration.py", line 124, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\migrations\operations\fields.py", line 104, in database_forwards
schema_editor.add_field(
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\sqlite3\schema.py", line 328, in add_field
self._remake_table(model, create_field=field)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\sqlite3\schema.py", line 189, in _remake_table
self.effective_default(create_field)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\base\schema.py", line 303, in effective_default
return field.get_db_prep_save(self._effective_default(field), self.connection)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 823, in get_db_prep_save
return self.get_db_prep_value(value, connection=connection, prepared=False)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 1378, in get_db_prep_value
value = self.get_prep_value(value)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 1357, in get_prep_value
value = super().get_prep_value(value)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 1217, in get_prep_value
return self.to_python(value)
File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 1339, in to_python
raise exceptions.ValidationError(
django.core.exceptions.ValidationError: ['“default_title” value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.']
]
no such column: articles_comment.pub_date
Помогите пожалуйста