I defined a schema like this:
@primary_key {:address, :string, autogenerate: false}
schema "validators" do
field :name, :string
field :logo, :string
field :status, :integer
timestamps()
end
and I has inserted a record to DB table:
0x01 myname test_log 0 2024-01-19 03:30:54 2024-01-19 07:14:25
Now I intend to update this record like this, and I hope the other columns: “logo”, “status” to be set to defaut value.
update validators set name = "new_name" where address = "0x01"
I noticed the cast/4 function has a empty_values option, so, does this option can do this for me? and how to do?
Thanks.