Skip to content

Commit f78562f

Browse files
committed
fix: schema
1 parent 0674de9 commit f78562f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pragma-entities/src/schema.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ diesel::table! {
1212
}
1313

1414
diesel::table! {
15-
entries (id) {
15+
entries (id, timestamp) {
1616
id -> Uuid,
1717
pair_id -> Varchar,
1818
publisher -> Text,
@@ -33,4 +33,8 @@ diesel::table! {
3333
}
3434
}
3535

36-
diesel::allow_tables_to_appear_in_same_query!(currencies, entries, publishers,);
36+
diesel::allow_tables_to_appear_in_same_query!(
37+
currencies,
38+
entries,
39+
publishers,
40+
);

pragma-node/src/infra/repositories/entry_repository.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub async fn get_median_price(
9696
WHERE
9797
pair_id = $1
9898
ORDER BY
99-
time
99+
time DESC
100100
LIMIT 1;
101101
"#;
102102

0 commit comments

Comments
 (0)