Ecto Migration -- Setting a default for existing rows for a new not null column

You could have used this :

  def change do
    alter table(:example) do
      add :newcolumn, :string, null: false
    end
    execute "update example set newcolumn = whatever_you_want"
  end```