<blockquote>
<p>EDIT - I'm putting a comment below at the top of this as it's important to read it before the > accepted answer that follows @andybak</p>
<blockquote>
<p>@Dominique: Your advice regarding manage.py reset south is dangerous
and may destroy the database if there are any third party apps using
south in the project, as pointed out by @thnee below. Since your
answer has so many upvotes I'd really appreciate it if you could edit
it and add at least a warning about this, or (even better) change it
to reflect @hobs approach (which is just as convenient, but doesn't
affect other apps) - thanks! – chrisv Mar 26 '13 at 9:09</p>
</blockquote>
<p>接受的答案如下:</p>
</blockquote>
<p>首先,<a href="http://groups.google.com/group/south-users/browse_thread/thread/888413f195acd9c2/0ee513da38240e19" rel="noreferrer">an answer by the South author</a>:</p>
<blockquote>
<p>As long as you take care to do it on all deployments simultaneously, there shouldn't be any problem with this. Personally, I'd do:</p>
<pre><code> rm -r appname/migrations/
./manage.py reset south
./manage.py convert_to_south appname
</code></pre>
<p>(Notice that the “<code>reset south</code>” part clears migration records for ALL apps, so make sure you either run the other two lines for all apps or delete selectively).</p>
<p>The <code>convert_to_south</code> call at the end makes a new migration and fake-applies it (since your database already has the corresponding tables). There's no need to drop all the app tables during the process.</p>
</blockquote>
<p>下面是我在dev+生产服务器上需要摆脱所有这些不必要的dev迁移时所做的工作:</p>
<ol>
<li>确保两边都有相同的数据库模式</li>
<li>删除两侧的每个迁移文件夹</li>
<li>run./manage.py reset south(正如post所说)on both sides=清除south表*</li>
<li>在两侧运行./manage.py<strong>将_转换为_south</strong>(伪造0001迁移)</li>
<li>然后我可以重新开始进行迁移并将迁移文件夹推送到我的服务器上</li>
</ol>
<p>*除非你只想清理一个应用程序,否则你需要编辑你的south_history表,只删除关于你的应用程序的条目。</p>