{"id":1748,"date":"2026-01-18T11:17:19","date_gmt":"2026-01-18T03:17:19","guid":{"rendered":"https:\/\/notes.coremix.net\/?p=1748"},"modified":"2026-01-18T11:17:19","modified_gmt":"2026-01-18T03:17:19","slug":"django-devprod%e6%95%b0%e6%8d%ae%e5%ba%93%e6%9b%b4%e6%94%b9%e7%ad%96%e7%95%a5%e8%a7%84%e8%8c%83-%e5%a6%82%e4%bd%95%e4%bf%9d%e8%af%81%e6%9c%ac%e5%9c%b0%e6%b5%8b%e8%af%95%e7%9a%84","status":"publish","type":"post","link":"https:\/\/notes.coremix.net\/?p=1748","title":{"rendered":"django dev&amp;prod\u6570\u636e\u5e93\u66f4\u6539\u7b56\u7565\u89c4\u8303\u2014\u2014\u5982\u4f55\u4fdd\u8bc1\u672c\u5730\u6d4b\u8bd5\u7684\u6570\u636e\u5e93\u4fee\u6539\u80fd\u5b89\u5168\u4e0a\u7ebf"},"content":{"rendered":"\n<p>\u5728 Django \u9879\u76ee\u4e2d\uff0c<strong>\u672c\u5730\u5f00\u53d1\u9636\u6bb5\u4ea7\u751f\u5927\u91cf migrations \u6587\u4ef6\u5e76\u4e0d\u662f\u95ee\u9898<\/strong>\u3002<br>\u771f\u6b63\u7684\u98ce\u9669\u5728\u4e8e\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u6570\u636e\u5e93\u53d8\u66f4\u662f\u5426\u80fd\u5728 <strong>\u9884\u53d1 \/ \u751f\u4ea7\u73af\u5883\u4e2d\u5b89\u5168\u3001\u53ef\u63a7\u3001\u53ef\u56de\u6eda\u5730\u6267\u884c<\/strong>\u3002<\/p>\n<\/blockquote>\n\n\n\n<p>\u672c\u6587\u603b\u7ed3\u4e86\u4e00\u5957 <strong>\u7ecf\u8fc7\u5927\u91cf Django \u9879\u76ee\u9a8c\u8bc1\u7684\u6570\u636e\u5e93\u53d8\u66f4\u7b56\u7565\u89c4\u8303<\/strong>\uff0c\u9002\u7528\u4e8e\u4e2a\u4eba\u9879\u76ee\u548c\u56e2\u961f\u534f\u4f5c\uff0c\u53ef\u76f4\u63a5\u4f5c\u4e3a\u56e2\u961f\u5f00\u53d1\u5b88\u5219\u4f7f\u7528\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u6838\u5fc3\u539f\u5219\uff08\u5fc5\u987b\u9075\u5b88\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 \u751f\u4ea7\u73af\u5883\u53ea\u5141\u8bb8\u505a\u4e24\u4ef6\u4e8b<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u62c9\u53d6\u4ee3\u7801\uff08<strong>\u5305\u542b migrations \u6587\u4ef6<\/strong>\uff09<\/li>\n\n\n\n<li>\u6267\u884c\uff1a<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npython manage.py migrate\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 \u4e25\u7981\u5728\u751f\u4ea7\u73af\u5883\u624b\u52a8\u6539\u8868\u7ed3\u6784<\/h3>\n\n\n\n<p>\u4efb\u4f55\u5f62\u5f0f\u7684\u624b\u52a8 <code>ALTER TABLE<\/code> \u90fd\u4f1a\u5bfc\u81f4\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u672c\u5730 \/ \u7ebf\u4e0a\u6570\u636e\u5e93\u72b6\u6001\u6f02\u79fb\uff08schema drift\uff09<\/li>\n\n\n\n<li>\u540e\u7eed migration \u6267\u884c\u5931\u8d25<\/li>\n\n\n\n<li>\u6570\u636e\u5e93\u72b6\u6001\u4e0d\u53ef\u8ffd\u6eaf<\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udc49 <strong>\u6570\u636e\u5e93\u7ed3\u6784\u7684\u552f\u4e00\u4e8b\u5b9e\u6765\u6e90\uff1aGit \u4e2d\u7684 migration \u6587\u4ef6<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3\ufe0f\u20e3 \u5df2\u7ecf\u4e0a\u7ebf\u6267\u884c\u8fc7\u7684 migration \u6587\u4ef6\uff0c\u6c38\u8fdc\u4e0d\u8981\u4fee\u6539<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u274c \u4e0d\u8981\u6539\u5b57\u6bb5<\/li>\n\n\n\n<li>\u274c \u4e0d\u8981\u6539\u4f9d\u8d56<\/li>\n\n\n\n<li>\u274c \u4e0d\u8981\u6539\u987a\u5e8f<\/li>\n<\/ul>\n\n\n\n<p>\u5982\u679c\u9700\u8981\u4fee\u6b63\u9519\u8bef\uff1a<\/p>\n\n\n\n<p>\u2705 <strong>\u65b0\u5efa\u4e00\u4e2a migration \u6765\u4fee<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u672c\u5730\u4e00\u5806 migrations\uff0c\u53d1\u5e03\u65f6\u600e\u4e48\u4fdd\u8bc1\u7ebf\u4e0a\u5b89\u5168\uff1f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u6807\u51c6\u505a\u6cd5\uff08\u63a8\u8350\uff09<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u672c\u5730\u5f00\u53d1\u5b8c\u6210\u540e\uff1a <code>python manage.py makemigrations python manage.py migrate<\/code><\/li>\n\n\n\n<li>\u5c06 <strong>\u6240\u6709 migration \u6587\u4ef6\u63d0\u4ea4\u5230 Git<\/strong><\/li>\n\n\n\n<li>\u53d1\u5e03\u5230\u7ebf\u4e0a\u540e\u6267\u884c\uff1a <code>python manage.py migrate<\/code><\/li>\n<\/ol>\n\n\n\n<p>Django \u4f1a\u6839\u636e <code>django_migrations<\/code> \u8868\u5224\u65ad\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u54ea\u4e9b migration \u5df2\u6267\u884c<\/li>\n\n\n\n<li>\u54ea\u4e9b\u662f\u65b0\u589e\u7684<br>\ud83d\udc49 <strong>\u53ea\u6267\u884c\u672a\u6267\u884c\u8fc7\u7684\u8fc1\u79fb<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u662f Django migration \u673a\u5236\u7684\u6838\u5fc3\u8bbe\u8ba1\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u53d1\u5e03\u524d\u7684\u5f3a\u5236\u68c0\u67e5\u6e05\u5355\uff08\u5efa\u8bae\u653e\u8fdb CI\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 1. \u68c0\u67e5\u662f\u5426\u6709\u672a\u751f\u6210\u7684 migration<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npython manage.py makemigrations --check --dry-run\n\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>\u975e 0 \u9000\u51fa \u2192 <strong>\u76f4\u63a5\u963b\u65ad\u53d1\u5e03<\/strong><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 2. \u786e\u4fdd\u8fc1\u79fb\u5728\u5e72\u51c0\u6570\u636e\u5e93\u80fd\u8dd1\u901a<\/h3>\n\n\n\n<p>\u5728 CI \/ staging \u73af\u5883\u6267\u884c\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npython manage.py migrate\npython manage.py test\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 3. \u5ba1\u67e5\u8fc1\u79fb\u8ba1\u5212\uff08\u9632\u6b62\u8bef\u64cd\u4f5c\uff09<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npython manage.py migrate --plan\n\n<\/pre><\/div>\n\n\n<p>\u91cd\u70b9\u5173\u6ce8\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u662f\u5426\u6709\u5220\u5b57\u6bb5<\/li>\n\n\n\n<li>\u662f\u5426\u6709\u5b57\u6bb5\u7c7b\u578b\u53d8\u66f4<\/li>\n\n\n\n<li>\u662f\u5426\u6709\u5927\u8868\u64cd\u4f5c<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u9884\u53d1 \/ \u7070\u5ea6\u73af\u5883\u662f\u5173\u952e\u7f13\u51b2\u533a<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u63a8\u8350\u53d1\u5e03\u6d41\u7a0b<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4f7f\u7528<strong>\u4e0e\u7ebf\u4e0a\u5b8c\u5168\u4e00\u81f4\u7684\u6784\u5efa\u4ea7\u7269<\/strong><\/li>\n\n\n\n<li>\u90e8\u7f72\u5230 staging<\/li>\n\n\n\n<li>\u6267\u884c\uff1a <code>python manage.py migrate<\/code><\/li>\n\n\n\n<li>\u8dd1\u5192\u70df \/ \u56de\u5f52\u6d4b\u8bd5\uff08\u5c24\u5176\u662f\u6d89\u53ca\u6570\u636e\u8fc1\u79fb\u7684\u529f\u80fd\uff09<\/li>\n\n\n\n<li>\u786e\u8ba4\u65e0\u8bef\u540e\u518d\u53d1\u5e03\u7ebf\u4e0a<\/li>\n<\/ol>\n\n\n\n<p>\u26a0\ufe0f <strong>\u4e0d\u8981\u8ba9\u201c\u5f00\u53d1\u8005\u672c\u5730\u6570\u636e\u5e93\u72b6\u6001\u201d\u6210\u4e3a\u4e8b\u5b9e\u6765\u6e90<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u591a\u4eba\u534f\u4f5c\u4e2d\u7684 migration \u51b2\u7a81\u5904\u7406<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5e38\u89c1\u95ee\u9898<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e24\u4e2a\u4eba\u5728\u540c\u4e00\u4e2a app \u4e0b\u90fd\u751f\u6210\u4e86 <code>0005_xxx.py<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b63\u786e\u5904\u7406\u65b9\u5f0f<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npython manage.py makemigrations --merge\n\n<\/pre><\/div>\n\n\n<p>Django \u4f1a\u751f\u6210\u4e00\u4e2a <strong>merge migration<\/strong> \u6765\u5408\u5e76\u4f9d\u8d56\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u56e2\u961f\u534f\u4f5c\u5efa\u8bae<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e00\u4e2a PR \u5bf9\u5e94\u4e00\u7ec4 migrations<\/li>\n\n\n\n<li>\u5408\u5e76\u524d rebase<\/li>\n\n\n\n<li>\u89e3\u51b3 migration \u7f16\u53f7\u51b2\u7a81\u540e\u518d\u5408\u5e76<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u8981\u4e0d\u8981\u5408\u5e76\uff08squash\uff09 migrations\uff1f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ed3\u8bba\uff1a<strong>\u53ef\u4ee5\uff0c\u4f46\u4e0d\u662f\u5fc5\u987b<\/strong><\/h3>\n\n\n\n<p>\u9002\u5408 squash \u7684\u573a\u666f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9879\u76ee\u8fd0\u884c\u534a\u5e74 \/ \u4e00\u5e74\u4ee5\u4e0a<\/li>\n\n\n\n<li>\u5355\u4e2a app migration \u6587\u4ef6\u8fc7\u591a\uff0c\u5f71\u54cd\u7ef4\u62a4<\/li>\n\n\n\n<li>\u65b0\u73af\u5883\u521d\u59cb\u5316\u8fc1\u79fb\u901f\u5ea6\u660e\u663e\u53d8\u6162<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f7f\u7528\u65b9\u5f0f<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npython manage.py squashmigrations your_app 0001 0050\n\n<\/pre><\/div>\n\n\n<p>\u26a0\ufe0f \u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>squash \u540e\u901a\u5e38\u9700\u8981\u4fdd\u7559\u65e7 migration \u4e00\u6bb5\u65f6\u95f4<\/li>\n\n\n\n<li>\u8fd9\u662f <strong>\u7ef4\u62a4\u6027\u4f18\u5316<\/strong>\uff0c\u4e0d\u662f\u53d1\u5e03\u5b89\u5168\u7684\u5fc5\u8981\u6761\u4ef6<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u7ebf\u4e0a\u201c\u5b89\u5168\u66f4\u6539\u201d\u7684\u771f\u6b63\u96be\u70b9\uff1a\u5927\u8868 &amp; \u9501\u8868\u98ce\u9669<\/h2>\n\n\n\n<p>\u5373\u4f7f migrate \u6d41\u7a0b\u6b63\u786e\uff0c<strong>SQL \u672c\u8eab\u4e5f\u53ef\u80fd\u5bfc\u81f4\u7ebf\u4e0a\u4e8b\u6545<\/strong>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u9ad8\u98ce\u9669\u64cd\u4f5c\u5217\u8868<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7ed9\u5927\u8868\u65b0\u589e <strong>NOT NULL<\/strong> \u5b57\u6bb5<\/li>\n\n\n\n<li>\u4fee\u6539\u5b57\u6bb5\u7c7b\u578b<\/li>\n\n\n\n<li>\u7ed9\u5927\u8868\u52a0\u7d22\u5f15<\/li>\n\n\n\n<li>RunPython \u4e00\u6b21\u6027\u8fc1\u79fb\u5927\u91cf\u6570\u636e<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u63a8\u8350\u7684\u4f4e\/\u96f6\u505c\u673a\u6570\u636e\u5e93\u53d8\u66f4\u7b56\u7565<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u65b0\u589e\u5b57\u6bb5\uff08\u4e24\u6b65\u8d70\uff09<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u65b0\u589e\u5b57\u6bb5\uff0c\u5141\u8bb8 <code>NULL<\/code><\/li>\n\n\n\n<li>\u4ee3\u7801\u517c\u5bb9\u65b0\u65e7\u5b57\u6bb5<\/li>\n\n\n\n<li>\u540e\u53f0\u4efb\u52a1 \/ \u811a\u672c\u5206\u6279\u56de\u586b\u6570\u636e<\/li>\n\n\n\n<li>\u518d\u6b21 migration\uff1a\u6539\u6210 <code>NOT NULL<\/code> \/ \u52a0\u7ea6\u675f<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u4fee\u6539\u5b57\u6bb5\u7c7b\u578b\uff08\u4e09\u6b65\u8d70\uff09<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u65b0\u589e\u65b0\u5b57\u6bb5\uff08\u65b0\u7c7b\u578b\uff09<\/li>\n\n\n\n<li>\u53cc\u5199 + \u5206\u6279\u8fc1\u79fb\u6570\u636e<\/li>\n\n\n\n<li>\u5207\u6362\u8bfb\u5199\u5230\u65b0\u5b57\u6bb5<\/li>\n\n\n\n<li>\u5220\u9664\u65e7\u5b57\u6bb5<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u52a0\u7d22\u5f15<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5927\u8868\u7d22\u5f15\u9700\u8981\u7279\u522b\u8c28\u614e<\/li>\n\n\n\n<li>PostgreSQL \u5efa\u8bae\u4f7f\u7528 <strong>CONCURRENTLY<\/strong><\/li>\n\n\n\n<li>Django \u539f\u751f\u4e0d\u4e00\u5b9a\u9ed8\u8ba4\u652f\u6301\uff0c\u9700\u8981\u81ea\u5b9a\u4e49 Migration<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e5d\u3001\u6570\u636e\u8fc1\u79fb\uff08RunPython\uff09\u7684\u6700\u4f73\u5b9e\u8df5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5f3a\u70c8\u5efa\u8bae<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u63d0\u4f9b <code>reverse_code<\/code>\uff0c\u4fdd\u8bc1\u53ef\u9006<\/li>\n\n\n\n<li>\u4e0d\u8981\u4e00\u6b21\u6027\u5904\u7406\u767e\u4e07\u7ea7\u6570\u636e<\/li>\n\n\n\n<li>migration \u53ea\u505a\u8f7b\u903b\u8f91<\/li>\n\n\n\n<li>\u91cd\u6570\u636e\u8fc1\u79fb\u7528\uff1a\n<ul class=\"wp-block-list\">\n<li>\u540e\u53f0\u4efb\u52a1<\/li>\n\n\n\n<li>\u7ba1\u7406\u547d\u4ee4<\/li>\n\n\n\n<li>\u79bb\u7ebf\u811a\u672c<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u3001\u7ebf\u4e0a\u53d1\u5e03\u7684\u6807\u51c6\u64cd\u4f5c\u6d41\u7a0b<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5e38\u89c4\u53d1\u5e03<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npython manage.py migrate\npython manage.py collectstatic --noinput\n# \u6eda\u52a8\u91cd\u542f\u670d\u52a1\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u6709\u98ce\u9669\u7684 schema \u53d8\u66f4<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53d1\u5e03\u524d\u786e\u4fdd\u5907\u4efd\u6216\u53ef\u56de\u6eda\u65b9\u6848<\/li>\n\n\n\n<li>\u5fc5\u987b staging \u5168\u6d41\u7a0b\u6f14\u7ec3<\/li>\n\n\n\n<li>\u4f4e\u5cf0\u671f\u6267\u884c\u6216\u7070\u5ea6\u53d1\u5e03<\/li>\n<\/ul>\n\n\n\n<p>\u26a0\ufe0f <strong>\u6570\u636e\u5e93\u56de\u6eda\u5f80\u5f80\u6bd4\u4ee3\u7801\u56de\u6eda\u56f0\u96be\u5f97\u591a<\/strong><br>\u5220\u5b57\u6bb5 \/ \u6539\u7c7b\u578b\u524d\u4e00\u5b9a\u8981\u60f3\u6e05\u695a\u56de\u9000\u8def\u5f84\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e00\u3001\u53ef\u76f4\u63a5\u91c7\u7528\u7684\u56e2\u961f\u6570\u636e\u5e93\u89c4\u8303\uff08\u63a8\u8350\uff09<\/h2>\n\n\n\n<p>\u2705 migrations \u5fc5\u987b\u8fdb Git<br>\u2705 CI \u5fc5\u987b <code>makemigrations --check<\/code><br>\u2705 staging \u5fc5\u987b\u5148 migrate + \u5192\u70df<br>\u2705 \u7ebf\u4e0a\u5df2\u6267\u884c migration \u4e0d\u5141\u8bb8\u4fee\u6539<br>\u2705 \u5927\u8868\u53d8\u66f4\u5fc5\u987b\u62c6\u5206\uff08\u517c\u5bb9 \u2192 \u56de\u586b \u2192 \u6536\u53e3\uff09<br>\u2705 \u5927\u6570\u636e\u8fc1\u79fb\u4e0d\u7528 migration \u4e00\u6b21\u6027\u8dd1\u5b8c<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u7ed3\u8bed<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Django \u7684 migration \u673a\u5236\u672c\u8eab\u5df2\u7ecf\u975e\u5e38\u6210\u719f<\/strong><br>\u51fa\u95ee\u9898\u7684\uff0c\u5f80\u5f80\u4e0d\u662f\u6846\u67b6\uff0c\u800c\u662f\u6d41\u7a0b\u548c\u89c4\u8303\u3002<\/p>\n<\/blockquote>\n\n\n\n<p>\u53ea\u8981\u4f60\u505a\u5230\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6570\u636e\u5e93\u7ed3\u6784\u7531 migration \u552f\u4e00\u9a71\u52a8<\/li>\n\n\n\n<li>\u6bcf\u6b21\u53d1\u5e03\u4e25\u683c\u8d70 staging \u2192 prod<\/li>\n\n\n\n<li>\u5927\u8868\u53d8\u66f4\u62c6\u6b65\u9aa4\u3001\u53ef\u56de\u6eda<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Django \u9879\u76ee\u4e2d\uff0c\u672c\u5730\u5f00\u53d1\u9636\u6bb5\u4ea7\u751f\u5927\u91cf migrations \u6587\u4ef6\u5e76\u4e0d\u662f\u95ee\u9898\u3002\u771f\u6b63\u7684\u98ce\u9669\u5728\u4e8e\uff1a \u6570\u636e\u5e93 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1748","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/1748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1748"}],"version-history":[{"count":1,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/1748\/revisions"}],"predecessor-version":[{"id":1751,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/1748\/revisions\/1751"}],"wp:attachment":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}