0

In the notes for the SQLITE section, week 3, https://cs50.harvard.edu/web/2020/notes/4/#:~:text=delete%20your%20existing%20flight%20from%20New%20York%20to%20London It states:

Every time we make changes in models.py, we have to make migrations and then migrate. Note that you may have to delete your existing flight from New York to London, as it doesn’t fit in with the new database structure.

ndon, as it doesn’t fit in with the new database structure.

I'm running into an issue when I do

# Create New Migrations
python manage.py makemigration

# Migrate
python manage.py migrate

as i try to follow the lecture example.

Can someone please help me understand how to " delete your existing flight from New York to London,"?

Thank you

1

I was having the same problem. What worked for me was going back into Django shell and entering the following command.

Flight.objects.filter(id=1).delete()

Of course if there is more than one flight record you would have to delete each I suppose.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .