Problems with the build database encountered today
The Django Build database uses two commands, one Python manage.py makemigrations, and Python manage.py migrate
When designing a database table, be sure to figure out the relationship between tables and tables, because there is a dependency between the table and the table, you must first generate a table before you can generate the B table
Each registered app has a makemigrations folder, the file in this folder is the Record data table migration and change, if it is
Under normal circumstances, it is not a problem for Django to generate the migrated files by itself in order. And the situation I'm in now is that the project inside
The Makemigrations folder under the app has been deleted and can only be generated on its own, but using the above command alone will cause errors in the table structure, so
Use the Python manage.py makemigrations app name one-by-one in order to generate this folder, and then use the
Python manage.py migrate app name one to implement table changes, generate a changed table
So in the process of programming, no matter what is encountered at that time can not solve the problem, to maintain the mentality, make clear the principle, and then the remedy, of course, fools is also very important
Also, some people like to install force, please do not talk to him, the force of the people have their own days to collect, I listen to the good, don ' t care
Python manage.py makemigrations The problem of generating data changes