From d7204ddc3d2a48b09a343096a52eee42c5caa547 Mon Sep 17 00:00:00 2001 From: Nicholas Moen Date: Wed, 21 May 2025 16:34:39 -0600 Subject: [PATCH] update migration 'timestamps/1' docs to include ':null' option --- lib/ecto/migration.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ecto/migration.ex b/lib/ecto/migration.ex index 92f44240..22d29ab6 100644 --- a/lib/ecto/migration.ex +++ b/lib/ecto/migration.ex @@ -1283,8 +1283,8 @@ defmodule Ecto.Migration do @doc """ Adds `:inserted_at` and `:updated_at` timestamp columns. - Those columns are of `:naive_datetime` type and by default cannot be null. A - list of `opts` can be given to customize the generated fields. + Those columns are of `:naive_datetime` type. A list of `opts` can be given + to customize the generated fields. Following options will override the repo configuration specified by `:migration_timestamps` option. @@ -1300,6 +1300,8 @@ defmodule Ecto.Migration do * `:default` - the columns' default value. It can be a string, number, empty list, list of strings, list of numbers, or a fragment generated by `fragment/1`. + * `:null` - determines whether the column accepts null values. Defaults to + `false`. """ def timestamps(opts \\ []) when is_list(opts) do