Skip to main content

execute_migrate

Function execute_migrate 

Source
pub fn execute_migrate(args: &MigrateArgs) -> Result<(), CliError>
Expand description

执行 migrate 命令

  • --rollback:列出所有待迁移,可选打印 SQL(对齐 php think migrate
  • --rollback:列出最后一个迁移作为回滚目标(对齐 php think migrate:rollback

§离线模式说明

当前为离线模式:仅解析迁移目录并打印待执行内容,不连接数据库。 真正执行迁移需要在线模式(未来扩展,通过 Migrator::migrate 注入连接)。