OSDN Git Service

Regular updates
[twpd/master.git] / phoenix-migrations.md
index ee61fb9..21e3270 100644 (file)
@@ -3,7 +3,7 @@ title: "Phoenix: Ecto migrations"
 category: Elixir
 layout: 2017/sheet
 weight: -1
-updated: 2017-09-04
+updated: 2020-02-23
 ---
 
 ### Creating
@@ -49,7 +49,8 @@ create table(:documents) do
   add :body, :text
   add :age, :integer
   add :price, :float
-  add :price, :float, precision: 10, scale: 2
+  add :price, :float
+  add :price, :decimal, precision: 10, scale: 2
   add :published_at, :utc_datetime
   add :group_id, references(:groups)
   add :object, :json