docs: 更新 README 关于数据库迁移的说明
生产环境部署 - BlogFlare 至 Cloudflare Pages / 构建与自动化上线 (push) Successful in 1m36s
生产环境部署 - BlogFlare 至 Cloudflare Pages / 构建与自动化上线 (push) Successful in 1m36s
This commit is contained in:
1 parent
1eb18ef31e
commit
caef609fc8
1 file changed
+12
@@ -31,6 +31,18 @@ pnpm install
|
||||
pnpm dlx wrangler d1 execute blogflare-db --local --file=./schema.sql
|
||||
```
|
||||
|
||||
如果你已经初始化过数据库,请不要重新执行会重建表的 `schema.sql`,而应应用增量迁移:
|
||||
|
||||
```bash
|
||||
pnpm exec wrangler d1 migrations apply blogflare-db --local
|
||||
```
|
||||
|
||||
部署新版本前,再将同一批迁移应用到远端数据库:
|
||||
|
||||
```bash
|
||||
pnpm exec wrangler d1 migrations apply blogflare-db --remote
|
||||
```
|
||||
|
||||
### 3. 启动本地开发服务器
|
||||
|
||||
```bash
|
||||
|
||||
Reference in new issue
Block a user