zoukankan      html  css  js  c++  java
  • python django model创建表报错

    λ python manage.py migrate TestModel
    System check identified some issues:

    WARNINGS:
    ?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
    HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/3.0/ref/databases/#mysql-sql-mode
    Operations to perform:
    Apply all migrations: (none)
    Running migrations:
    No migrations to apply.
    Your models have changes that are not yet reflected in a migration, and so won't be applied.
    Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

    执行 

    python manage.py migrate

    报错误

      Your models have changes that are not yet reflected in a migration, and so won't be applied.   Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

    这个错误是因为你的数据库文件更改需要更新一下

     

    先执行下

    python manage.py makemigrations 

    在执行

    python manage.py migrate 

    就可以成功执行了

    $ python manage.py migrate TestModel   # 创建表结构
  • 相关阅读:
    记录。短信网关.
    TP 笔记~
    FUCK IE FLASH(inline hook)
    API HOOK(MessageBoxA)
    inline hook MessageBox(2)
    c#线程中使用 dataset
    匈牙利算法解决二分图最大匹配
    C#:Array类的排序
    C#:属性
    C#:结构
  • 原文地址:https://www.cnblogs.com/chengfengchi/p/13398543.html
Copyright © 2011-2022 走看看