【发布时间】:2017-02-15 03:45:08
【问题描述】:
我通过如下命令生成了一个模型:
mix phoenix.gen.html Project projects title:string
我想撤消此操作(删除所有已创建的文件/数据库记录):
* creating web/controllers/project_controller.ex
* creating web/templates/project/edit.html.eex
* creating web/templates/project/form.html.eex
* creating web/templates/project/index.html.eex
* creating web/templates/project/new.html.eex
* creating web/templates/project/show.html.eex
* creating web/views/project_view.ex
* creating test/controllers/project_controller_test.exs
* creating web/models/project.ex
* creating test/models/project_test.exs
* creating priv/repo/migrations/20170214192223_create_project.exs
是否有一个命令可以用来执行此操作,而不是手动删除所有文件?如果是这样,该命令是什么?
例如:在 Rails 中,您可以使用 rails d scaffold ... 来撤消 rails g scaffold 命令。
另一种选择是使用我的版本控制系统 (git) 来完成此操作;但是,删除mix phoenix.gen.html 生成的文件的命令会很好。
提前致谢!
【问题讨论】: