首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法迁移挂起的迁移

无法迁移挂起的迁移
EN

Stack Overflow用户
提问于 2015-04-06 05:43:07
回答 1查看 376关注 0票数 0

我将我的django项目部署到heroku,并尝试迁移我的挂起的迁移,但在运行迁移命令时出现问题。首先我进行迁移,然后我开始迁移,但它显示

您的模型具有尚未在迁移中反映的更改,因此将不会应用。运行'manage.py makemigrations‘进行新的迁移,然后重新运行

代码语言:javascript
复制
  (postjust)erkans-MacBook-Air:postjust erkan$ heroku run python  manage.py makemigrations
        /Users/erkan/.rvm/gems/ruby-2.1.1/gems/heroku-3.7.5/lib/heroku/helpers.rb:93: warning: Insecure world writable dir /Users/erkan/Dev`enter code here`/Python in PATH, mode 040777
        Running `python manage.py makemigrations` attached to terminal... up, run.8854
        Migrations for 'pages':
          0002_auto_20150405_2137.py:
            - Alter field content on page
            - Alter field date on page
        Migrations for 'blog':
          0006_auto_20150405_2137.py:
            - Remove field categories from page
            - Delete model Page
            - Alter field date on blogcategory
            - Alter field date on blogpost


    (postjust)erkans-MacBook-Air:postjust erkan$ heroku run python  manage.py migrate
    /Users/erkan/.rvm/gems/ruby-2.1.1/gems/heroku-3.7.5/lib/heroku/helpers.rb:93: warning: Insecure world writable dir /Users/erkan/Dev/Python in PATH, mode 040777
    Running `python manage.py migrate` attached to terminal... up, run.9864
    Operations to perform:
      Synchronize unmigrated apps: django_extensions, tinymce
      Apply all migrations: sessions, contenttypes, pages, admin, auth, blog
    Synchronizing apps without migrations:
      Creating tables...
      Installing custom SQL...
      Installing indexes...
    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.

我找不到问题所在。

EN

回答 1

Stack Overflow用户

发布于 2015-04-06 06:00:32

你不应该远程运行makemigrations。heroku run会为每个命令创建一个新的dyno,因此您创建的迁移会立即丢失。

在本地运行makemigrations命令,将它们提交到git,然后推送到heroku,它们将自动运行。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29462558

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档