Replies: 1 comment
-
Oh, I see! I should overwrite new function pk(m::Type{T}) in SearchLight.jl is function pk(m::Type{T})::String where {T<:AbstractModel}
# "id"
fieldnames(m)[findfirst(x->x==DbId, m.types)] |> string
end new function SearchLight.update_query_part in SearchLightPostgreSQL.jl is function SearchLight.update_query_part(m::T)::String where {T<:SearchLight.AbstractModel}
update_values = join(map(x -> "$(string(SearchLight.SQLColumn(x))) = $(string(SearchLight.to_sqlinput(m, Symbol(x), getfield(m, Symbol(x)))) )", SearchLight.persistable_fields(typeof(m))), ", ")
kn = SearchLight.primary_key_name(typeof(m))
" $update_values WHERE $(SearchLight.table(typeof(m))).$(kn) = '$(getproperty(m,kn).value)'"
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It can run
SearchLight.Migration.last_up()
, but cannot insert values withMyGenieApp.Tables.seed()
for losing section "id".BTW,
all(model)
causesto_model
error:Beta Was this translation helpful? Give feedback.
All reactions