zoukankan      html  css  js  c++  java
  • Only the sqlmigrate and sqlflush commands can be used when an app has migrations.

    samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$ python manage.py sqlall getssh
    System check identified some issues:
    
    WARNINGS:
    ?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.
    CommandError: App 'getssh' has migrations. Only the sqlmigrate and sqlflush commands can be used when an app has migrations.
    samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$
    samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh/getssh$ mv migrations/ migrations.back/
    samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh/getssh$
    samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$ python manage.py sql getssh
    System check identified some issues:
    
    WARNINGS:
    ?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.
    BEGIN;
    CREATE TABLE `getssh_publisher` (
        `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
        `name` varchar(30) NOT NULL,
        `address` varchar(50) NOT NULL,
        `city` varchar(60) NOT NULL,
        `state_province` varchar(30) NOT NULL,
        `country` varchar(50) NOT NULL,
        `website` varchar(200) NOT NULL
    )
    ;
    CREATE TABLE `getssh_author` (
        `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
        `first_name` varchar(30) NOT NULL,
        `last_name` varchar(40) NOT NULL,
        `email` varchar(254) NOT NULL
    )
    ;
    CREATE TABLE `getssh_book_authors` (
        `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
        `book_id` integer NOT NULL,
        `author_id` integer NOT NULL,
        UNIQUE (`book_id`, `author_id`)
    )
    ;
    ALTER TABLE `getssh_book_authors` ADD CONSTRAINT `author_id_refs_id_20f26b36` FOREIGN KEY (`author_id`) REFERENCES `getssh_author` (`id`);
    CREATE TABLE `getssh_book` (
        `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
        `title` varchar(100) NOT NULL,
        `publisher_id` integer NOT NULL,
        `publication_date` date NOT NULL
    )
    ;
    ALTER TABLE `getssh_book` ADD CONSTRAINT `publisher_id_refs_id_99765d4d` FOREIGN KEY (`publisher_id`) REFERENCES `getssh_publisher` (`id`);
    ALTER TABLE `getssh_book_authors` ADD CONSTRAINT `book_id_refs_id_2cfb1c02` FOREIGN KEY (`book_id`) REFERENCES `getssh_book` (`id`);
    
    COMMIT;
    samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$
    View Code

    提示Only the sqlmigrate and sqlflush commands can be used when an app has migrations.

    将apps目录下面的migrations文件夹删除掉,或者重命名一下即可.

  • 相关阅读:
    利用connect建立前端开发服务器
    Bootstrap Popover 隐藏的Javasript方法
    Kafka 2.1.0压缩算法性能测试
    关于Kafka java consumer管理TCP连接的讨论
    Java API获取consumer group最新提交位移的时间
    关于Kafka producer管理TCP连接的讨论
    【译】Apache Kafka支持单集群20万分区
    关于Kafka broker IO的讨论
    Kafka 2.0 ConsumerGroupCommand新功能
    关于Kafka high watermark的讨论2
  • 原文地址:https://www.cnblogs.com/drgcaosheng/p/5860012.html
Copyright © 2011-2022 走看看