【问题标题】:How to Remove Ecto Model from Phoenix Application如何从 Phoenix 应用程序中删除 Ecto 模型
【发布时间】: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 生成的文件的命令会很好。

提前致谢!

【问题讨论】:

    标签: elixir phoenix-framework


    【解决方案1】:

    看起来 Chris McCord 反对在 Phoenix 框架中实现此功能:

    https://github.com/phoenixframework/phoenix/issues/1597

    我必须使用版本控制系统来完成这项工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-13
      • 2017-06-09
      • 1970-01-01
      • 2016-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多