I am using Django 2.2 with Python 3.7 on Windows 10.
I created a project and then an app. The models.py was populated by using INSPECTDB for an existing Postgres database. I removed the line 'managed = False' from each class.
I created the initial makemigrations and did the migrate. There are app migration files, 0001_initial.py and init.py
I had to make changes, adding more classes, in the models.py file. Then I ran the makemigration and migrate on the app.
Now I get a message '.errors.DuplicateTable: relation "INT_ORG" already exists.' Throws an exception.
I tried to use 'python manage.py makemigrations' and got the message that there were no changes detected.
I tried to use 'python manage.py migrate --fake-initial'. ThisErrored with duplicate table already exists
No luck. I'm failing badly here.
And while working yesterday, somehow - don't know how, another migration file shows up called '0002_auto_20191212_1137.py' The '0002_auto_20191212_1137.py' migration file has all my changes in it. But it is not being migrated either when I try to makemigrations and migrate.
I need to go back to a point I can understand and not loose everything. A co-worker had a similar problem and they just started a new project and new app. I don't want to have to do that.
Can someone please tell me how to delete the migration files: 0001_initial.py and 0002_auto_20191212_1137.py ?I would like to do this in the terminal window of PyCharm for Django.
I have tried this code to remove migrations:'delete from django_migrations where app = myapp'and got the error:'delete' is not recognized as an internal or external command, operable program or batch file.
I have tried this code to remove migrations:'git rm myapp/migrations/*'and got the error:'git' is not recognized as an internal or external command, operable program or batch file.
I have tried this code to remove migrations:'remove myapp/migrations/*'and got the error:'remove' is not recognized as an internal or external command, operable program or batch file.
I have looked at several sources on the internet and also in StackOverflow that are similiar to my problem, but no answers that work.
Would appreciate any help. Thank you.Mag