perhap buys in autodetector.py

12 views
Skip to first unread message

guzheng2000

unread,
Apr 19, 2018, 7:18:02 AM4/19/18
to Django users
Hi,

Django prompts "no changes..." when I want to re-create migration codes by calling makemigrations after remove all previous migration codes. After some digs, I found it can be fixed by changing:
[autodetector.py:151] "al not in self.from_state.real_apps " ==> "al not in self.to_state.real_apps"

Just let you guys know, I'm not sure it is correct.
thanks,
gz

Tim Graham

unread,
Apr 19, 2018, 10:02:26 AM4/19/18
to Django users
When you say, "remove all previous migration codes" -- you mean you removed all the migration files such as 0001_initial.py? In that case, make sure you don't remove the __init__.py file, otherwise you must use "makemigrations app_name".

Zheng Gu

unread,
Apr 19, 2018, 8:32:23 PM4/19/18
to django...@googlegroups.com
Yes, you are right, I removed all migrations folder, include any files in it(such as 0001_initial.py), and as you said, I have to run "makemigrations app_name" to generate new codes. To avoid these tedious work, I made a change: [questioner.py:42] return self.defaults.get("ask_initial", False) ==> return self.defaults.get("ask_initial", True) when calling makemigrations, and after created codes, change it back. I'm just not sure if it is correct to change autodetector.py.


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b0d0da83-2935-418f-85b8-433f0eac5cfc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages