Makemigrations/migrate in existing database

86 views
Skip to first unread message

Ankita Sharma

unread,
Jun 4, 2021, 8:58:35 AM6/4/21
to Django users

Hello Team
Hope all are doing great

I have a database in microsoft sql server. I created tables and views in it.

I ran py manage.py inspetdb  > Models.py and populated my models.py file . I also don't want my model to alter my database. I just want it for data retrieval.

Should I definitely run migrate/makemigrations?

After inspectdb should i apply makemigrations on my app or is just migrate enough? And also what are the points to remember while using inspectdb on an existing database.

Thanks in advance

Mahendra

unread,
Jun 4, 2021, 9:51:03 AM6/4/21
to django...@googlegroups.com
I think surely run makemigrations and migrate

Mahendra Yadav

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/908ff564-adca-4b64-9ec4-e347a3818efbn%40googlegroups.com.

Omkar D

unread,
Jun 8, 2021, 5:21:08 AM6/8/21
to Django users
```
python manage.py makemigrations
python manage.py migrate --fake
```

Gabriel Araya Garcia

unread,
Jun 8, 2021, 1:43:19 PM6/8/21
to django...@googlegroups.com
No. Only take sure That model structure about your tables should be the same fields in your database

--
Reply all
Reply to author
Forward
0 new messages