THE ERROR:
django.db.utils.ProgrammingError: column codeAT_code.promulgator does not exist
LINE 1: …".“slug”, “codeAT_code”.“affected_government_id”, "codeAT_co…
^
THE MIGRATIONS FILE:
migrations.AddField(
model_name=‘code’,
name=‘promulgator’,
field=models.CharField(blank=True, default=‘Continental Congress’, max_length=20, null=True),
),
RUNNING MAKEMIGRATIONS:
SystemCheckError: System check identified some issues:
ERRORS:
class ‘codeAT.admin.CodeAdmin’>: (admin.E027) The value of ‘prepopulated_fields’ refers to ‘slug’, which is not an attribute of ‘codeAT.ExtraOrdered’.
class ‘codeAT.admin.CodeAdmin’>: (admin.E030) The value of ‘prepopulated_fields[“slug”][0]’ refers to ‘arrow’, which is not an attribute of ‘codeAT.ExtraOrdered’.
ADMIN.PY:
class CodeAdmin(admin.ModelAdmin):
prepopulated_fields = {“slug”: (“arrow”,)}
…
class ExtraOrderedAdmin(admin.ModelAdmin):
pass
Looking at the postgres db from PyCharm, several of the new fields I added are not in the db OR in
the migration file. The new promulgator field made it to the migration file but not to the db. This
latest migration is not in django_migrations in the db. So this is all screwed up.
When I did the migrations, no errors were reported, but I did notice that for 3 renamed models, only
one was renamed, the other two were created.
Should I:
Throw it all out and start over?
Manually edit the database?
Edit the migration file?
Learn php/Laravel?
Many thanks.