@@ -217,10 +217,16 @@ defmodule Ecto.Migration do
217
217
218
218
config :app, App.Repo, migration_foreign_key: [column: :uuid, type: :binary_id]
219
219
220
- * `:migration_timestamps` - By default, Ecto uses the `:naive_datetime` type, but
221
- you can configure it via:
220
+ * `:migration_timestamps` - By default, Ecto uses the `:naive_datetime` as the type,
221
+ `:inserted_at` as the name of the column for storing insertion times, `:updated_at` as
222
+ the name of the column for storing last-updated-at times, but you can configure it
223
+ via:
222
224
223
- config :app, App.Repo, migration_timestamps: [type: :utc_datetime]
225
+ config :app, App.Repo, migration_timestamps: [
226
+ type: :utc_datetime,
227
+ inserted_at: :created_at,
228
+ updated_at: :changed_at
229
+ ]
224
230
225
231
* `:migration_lock` - By default, Ecto will lock the migration table. This allows
226
232
multiple nodes to attempt to run migrations at the same time but only one will
@@ -997,6 +1003,9 @@ defmodule Ecto.Migration do
997
1003
Those columns are of `:naive_datetime` type and by default cannot be null. A
998
1004
list of `opts` can be given to customize the generated fields.
999
1005
1006
+ Following options will override the repo configuration specified by
1007
+ `:migration_timestamps` option.
1008
+
1000
1009
## Options
1001
1010
1002
1011
* `:inserted_at` - the name of the column for storing insertion times.
0 commit comments