From 3e6c283be16c743d39a96f11d88490b2d864f18c Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 29 Aug 2017 17:05:24 +0800 Subject: [PATCH] phoenix-ecto: three columns --- phoenix-ecto@1.3.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/phoenix-ecto@1.3.md b/phoenix-ecto@1.3.md index f31c2db76..20fb8d3aa 100644 --- a/phoenix-ecto@1.3.md +++ b/phoenix-ecto@1.3.md @@ -6,14 +6,18 @@ tags: [WIP] updated: 201708.29 --- +## Schemas +{: .-three-column} + ### Generating ```bash -$ mix phx.gen.html Accounts Profile profiles email:string age:integer -``` - -```bash -$ mix phx.gen.html Accounts User users email:string hashed_password:string +$ mix phx.gen.html \ + Accounts \ # domain + Profile \ # schema + profiles \ # table name + email:string \ + age:integer ``` ### Schema @@ -25,9 +29,6 @@ defmodule Myapp.Accounts.User do schema "users" do field :name field :age, :integer - # :id :binary :integer :float :boolean :string :binary - # {:array, inner_type} :decimal :map - field :password, virtual: true timestamps()