So I'm a newbie in phoenix. I created a simple api
in my phoenix project the problem is that i want to add another field in my todo.ex
I want to add an author field in my todo.ex
FROM
defmodule TodoApi.Todo do
use TodoApi.Web, :model
schema "todos" do
field :description, :string
timestamps()
end
def changeset(struct, params \\ %{}) do
struct
|> cast(params, [:description])
|> validate_required([:description])
end
end
TO
defmodule TodoApi.Todo do
use TodoApi.Web, :model
schema "todos" do
field :description, :string
field :author, :string
timestamps()
end
def changeset(struct, params \\ %{}) do
struct
|> cast(params, [:description, :author])
|> validate_required([:description, :author])
end
end
But I'm getting an postgrex error 42703 column t0.author does not exist
Thanks in advance..