Python manage.py makemigrations The problem of generating data changes

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.