Closed LarryMays92 closed 2 years ago
curious, have we tried removing all the current migration files and making a new one ?
delete all the migrations except the first one like we did yesterday?
even get rid of that one so we make 1 'super all encompassing' migration
so delete all of them?
yes
its still showing them when i run show migrations do i need to drop db?
yes
heyyyyyyy that was it i didnt drop db though but will i need to create superuser maybe?
if you didn't drop the database you should still have your superuser
Note, that we only ever want to do this in a development setting at relatively early stages of a project - because we can lose all of our data in the db and not have the correct way to rebuild it.
ok but i think i had dropped my db last night so i gotta do the superuser thing again it was so broke i couldnt get my admin page up before hopefully i wont have to migrate any more though
i can access my admin but i cant go to any of the models and they added in my admin.py
ProgrammingError at /admin/main_app/student/ column main_app_student.current_grade does not exist LINE 1: ...ent"."name", "main_app_student"."classification", "mainapp...
gettting this on the models
with self.db.wrap_database_errors: File "/Users/alexisdavenport/.local/share/virtualenvs/django-env-DblZDiee/lib/python3.10/site-packages/django/db/utils.py", line 91, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/Users/alexisdavenport/.local/share/virtualenvs/django-env-DblZDiee/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: column main_app_student.current_grade does not exist LINE 1: ...ent"."name", "main_app_student"."classification", "mainapp...
and this in terminal
which zoom room are you in ?
finna hop in one
room 22
we deleted migrations and dropped db created db added superuser and its working now !!!!!!!!!!! DREWSKI THE GOAT
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
Django
What's the problem you're trying to solve?
Trying To Make a New Migration
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
schema_editor.alter_field(from_model, from_field, to_field) File "/Users/alexisdavenport/.local/share/virtualenvs/django-env-DblZDiee/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 778, in alter_field raise ValueError( ValueError: Cannot alter field main_app.Course.students into main_app.Course.students - they are not compatible types (you cannot alter to or from M2M fields, or add or remove through= on M2M fields)
What is your best guess as to the source of the problem?
there is an issue with my many to many field
What things have you already tried to solve the problem?
research, questions, etc
Paste a link to your repository here https://github.com/LarryMays92/MaysUniversity