作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
例如,我有 50 次迁移,并且我已将所有迁移压缩到 0001_initial.py 并在再次达到 50 次迁移后。我如何压制迁移?
最佳答案
在压缩新迁移之前,您需要将压缩的迁移转换为正常迁移,如 documentation 中所述。 (在本节末尾):
You must then transition the squashed migration to a normal migrationby:
- Deleting all the migration files it replaces.
- Updating all migrations that depend on the deleted migrations to depend on the squashed migration instead.
- Removing the replaces attribute in the Migrationclass of the squashed migration (this is how Django tells that it is asquashed migration).
关于django - 如何在 Django 中压缩压缩迁移?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36716491/
我是一名优秀的程序员,十分优秀!