檢視原始檔 mix phx.new.ecto (Phoenix v1.7.14)
在雨傘專案中建立新的 Ecto 專案。
此任務旨在建立不含網頁整合的基本 Ecto 專案,作為網際網路應用程式的網域核心應用程式,並與您的更大雨傘平台整合。
它期望專案名稱作為引數。
$ cd my_umbrella/apps
$ mix phx.new.ecto APP [--module MODULE] [--app APP]
將在給定的 APP 目錄中建立專案。除非給定 --module
或 --app
,否則應用程式名稱和模組名稱將從應用程式名稱中擷取。
選項
--app
- OTP 應用程式的名稱--module
- 在產生的主架構中的基本模組名稱--database
- 指定 Ecto 的資料庫配接器。其中之一postgres
- 透過 https://github.com/elixir-ecto/postgrexmysql
- 透過 https://github.com/elixir-ecto/myxqlmssql
- 透過 https://github.com/livehelpnow/tdssqlite3
- 透過 https://github.com/elixir-sqlite/ecto_sqlite3
如需更多資訊和需求,請查看驅動程式文件。預設為「postgres」。
--binary-id
- 將binary_id
用作 Ecto 架構中的主索引鍵類型
範例
$ mix phx.new.ecto hello_ecto
等於
$ mix phx.new.ecto hello_ecto --module HelloEcto