Adding timestamps to an existing table with Ecto's timestamps

巧了我就是萌 提交于 2019-12-05 04:19:26

I ran into the same issue. For me, this was dued to not specifying timestamps() in the Ecto schema:

schema "my_table" do
    field(:name, :string)
    ...
    timestamps() // <- Add this here
end

The migration just tells your DB that you have timestamps columns. You still need to tell Ecto that they exist!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!