当前位置:网站首页>Solution of database migration error
Solution of database migration error
2022-07-27 08:32:00 【pink_ Pig___】
When changing model classes :
When you need to change the model class
Delete tables and... In the database migrations Migration files in
Re migrate
Execute first
python manage.py makemigrations
Information after execution
-Create model User
Re execution python manage.py migrate You're going to report a mistake
No migrations to apply
When we are migrating files
A total of three party files will be generated , The migration file 、 Tables in the database and records of migration information
Here is an example of a project I wrote before
We open the database 
Migration open django_migrations Table will see the previous migration records

Because of this user The migration record database will think that we have completed the migration and will not be migrating
Execute again after deletion python manage.py migrate You can successfully migrate
Finally remember :
The migration file 、 Tables in the database and records of migration information are indispensable when deleting , The absence of any party will report an error .
边栏推荐
- Ubuntu: install PostgreSQL
- 如何在qsim查看软件对象的实例?
- Help send some recruitment. If you are interested, you can have a look
- [MRCTF2020]PYWebsite 1
- Cenos7 update MariaDB
- 1176 questions of Olympiad in informatics -- who ranked K in the exam
- Software test interview questions (key points)
- Weekly learning summary
- "PHP Basics" tags in PHP
- How does kettle handle text data transfer as' 'instead of null
猜你喜欢

虚拟机克隆

IBM3650M4实体机安装VCenter7.0

面试官:什么是脚手架?为什么需要脚手架?常用的脚手架有哪些?

After downloading URL loader and specifying the size of the image with limit, the image will not be displayed

Plato farm is expected to further expand its ecosystem through elephant swap
![[MRCTF2020]Ezpop 1](/img/c0/41873fe5864490ade403eeddc26976.png)
[MRCTF2020]Ezpop 1

Apache SSI remote command execution vulnerability

ERP production operation control Huaxia

Bandwidth and currency
![[BJDCTF2020]EasySearch 1](/img/ea/90ac6eab32c28e09bb1fab62b6b140.png)
[BJDCTF2020]EasySearch 1
随机推荐
Idea remote debugging
Attack and defense world MFW
Flask project configuration
Flask one to many database creation, basic addition, deletion, modification and query
"PHP Basics" tags in PHP
Background coupon management
Forced login, seven cattle cloud upload pictures
Login to homepage function implementation
Use of string type "PHP Basics"
Containerd failed to pull private database image (kubelet)
众昂矿业:新能源行业快速发展,氟化工产品势头强劲
STM32小bug汇总
Process control - Branch
阿里云国际版回执消息简介与配置流程
面试官:什么是脚手架?为什么需要脚手架?常用的脚手架有哪些?
sql_ Mode strict mode (ansi/traditional/strict_trans_tables)
Binglog backup data
[NPUCTF2020]ReadlezPHP 1
My senior
Explain cache consistency and memory barrier