Fix pullout_direction query issues

qa/reset_fixes
Rick Carlino 2020-04-12 12:47:10 -05:00
parent 446aeb007d
commit f463c698e0
3 changed files with 7 additions and 9 deletions

View File

@ -1 +1 @@
9.2.2-rc14
9.2.2-rc15

View File

@ -115,12 +115,8 @@ defmodule FarmbotCore.Asset.CriteriaRetriever do
x = Enum.join(fragments, " AND ")
sql = "SELECT id FROM points WHERE #{x}"
query_params = List.flatten(criteria)
IO.inspect(sql)
IO.inspect(query_params)
{:ok, query} = Repo.query(sql, query_params)
%Sqlite.DbConnection.Result{ rows: rows } = query
IO.puts("Results:")
IO.inspect(rows)
List.flatten(rows)
end

View File

@ -13,20 +13,21 @@ defmodule FarmbotCore.Asset.Point do
foreign_key: :asset_local_id
)
field(:discarded_at, :utc_datetime)
field(:gantry_mounted, :boolean)
field(:meta, :map)
field(:monitor, :boolean, default: true)
field(:name, :string)
field(:openfarm_slug, :string)
field(:plant_stage, :string)
field(:planted_at, :utc_datetime)
field(:pointer_type, :string)
field(:pullout_direction, :integer)
field(:radius, :float)
field(:tool_id, :integer)
field(:x, :float)
field(:y, :float)
field(:z, :float)
field(:tool_id, :integer)
field(:discarded_at, :utc_datetime)
field(:gantry_mounted, :boolean)
field(:monitor, :boolean, default: true)
timestamps()
end
@ -42,6 +43,7 @@ defmodule FarmbotCore.Asset.Point do
tool_id: point.tool_id,
discarded_at: point.discarded_at,
gantry_mounted: point.gantry_mounted,
pullout_direction: point.pullout_direction,
x: point.x,
y: point.y,
z: point.z