Skip to content

Commit

Permalink
order by result by entry_id and inserted_at, #40
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonLab committed Mar 6, 2019
1 parent c934649 commit 0eb4ce5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use Mix.Config

config :alog, Alog.Repo,
username: "postgres",
password: "docker",
database: "routinedb",
password: "postgres",
database: "test_app_dev",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox,
priv: "priv/repo/test_app/"
Expand Down
3 changes: 2 additions & 1 deletion lib/alog/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ defmodule Alog.Connection do
query_data["fields"],
" FROM ",
query_data["table_name"], " AS ", query_data["table_as"],
query_data["rest_query"]
query_data["rest_query"],
" ORDER BY #{query_data["table_as"]}.\"entry_id\", #{query_data["table_as"]}.\"inserted_at\" DESC",
]
)
end
Expand Down

0 comments on commit 0eb4ce5

Please sign in to comment.