Skip to content

Commit

Permalink
Update starter.md (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhennann authored Nov 23, 2023
1 parent f1509b9 commit 1e8a267
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/zh/starter.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ await user.remove();

### 使用迁移任务管理表结构变更

不过我们的 Portra 应用预算比较拮据,没有专门的 DMS 系统来管理表结构变更,幸好 Leoric 也提供迁移任务管理,通过编写表结构变更相关的迁移任务,我们通用可以将表结构变更纳入变更评审和版本管理
不过我们的 Portra 应用预算比较拮据,没有专门的 DMS 系统来管理表结构变更,幸好 Leoric 也提供迁移任务管理,通过编写表结构变更相关的迁移任务,我们就可以将表结构变更纳入变更评审和版本管理

例如,想要使用迁移任务创建用户表,大概有如下几个步骤:

Expand All @@ -80,7 +80,7 @@ await user.remove();

完成上述步骤之后,`User` 就可以用了。有关创建、修改、以及删除表的操作说明都可以参考《[迁移任务]({{ '/zh/migrations' | relative_url }})》一文。

另外,Leoric 也提供 `realm.sync({ force: true })` 的快捷方式,在 `User.attributes` 中声明属性信息,然后执行这个方法将属性信息同步到数据库即刻,将自动检查模型生命和实际表结构信息的差异,然后执行相应的创建、修改表的操作。
另外,Leoric 也提供 `realm.sync({ force: true })` 的快捷方式,在 `User.attributes` 中声明属性信息,然后执行这个方法将属性信息同步到数据库即可,将自动检查模型声明和实际表结构信息的差异,然后执行相应的创建、修改表的操作。

## 从 Sequelize 迁移

Expand Down

0 comments on commit 1e8a267

Please sign in to comment.