diff options
| author | Rutger Broekhoff | 2026-12-01 16:03:28 +0100 |
|---|---|---|
| committer | Rutger Broekhoff | 2026-12-01 16:03:28 +0100 |
| commit | a2b46df66ce12ac31392cbfe80b1f983a9350278 (patch) | |
| tree | 76805a95b221ecf8afed3075f09290f98789238a /server/src/database/connection.cpp | |
| parent | 9b8d8fccaec087031ba37dd68e516929c3ddb4a2 (diff) | |
| download | routemon-a2b46df66ce12ac31392cbfe80b1f983a9350278.tar.gz routemon-a2b46df66ce12ac31392cbfe80b1f983a9350278.zip | |
Reloading
Diffstat (limited to 'server/src/database/connection.cpp')
| -rw-r--r-- | server/src/database/connection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/database/connection.cpp b/server/src/database/connection.cpp index fcdf15f..95df208 100644 --- a/server/src/database/connection.cpp +++ b/server/src/database/connection.cpp | |||
| @@ -22,8 +22,8 @@ auto connection::insert_rwgps_notifications( | |||
| 22 | "RETURNING id", | 22 | "RETURNING id", |
| 23 | [¬if](auto& s) | 23 | [¬if](auto& s) |
| 24 | { | 24 | { |
| 25 | auto const ts = time::iso8601_secs(notif.rwgps_timestamp); | 25 | s.bind( |
| 26 | s.bind(":rwgps_timestamp", std::string_view{ts}); | 26 | ":rwgps_timestamp", time::iso8601_secs(notif.rwgps_timestamp)); |
| 27 | s.bind(":user_id", notif.user_id); | 27 | s.bind(":user_id", notif.user_id); |
| 28 | s.bind(":item_type", try_to_string(notif.item_type)); | 28 | s.bind(":item_type", try_to_string(notif.item_type)); |
| 29 | s.bind(":item_id", notif.item_id); | 29 | s.bind(":item_id", notif.item_id); |
| @@ -56,7 +56,7 @@ auto open(std::filesystem::path const& filename) -> std::shared_ptr<connection> | |||
| 56 | try | 56 | try |
| 57 | { | 57 | { |
| 58 | auto mversion = std::optional<std::int64_t>{}; | 58 | auto mversion = std::optional<std::int64_t>{}; |
| 59 | dbc.query("SELECT version FROM migration;").scan_row_max1(mversion); | 59 | dbc.query("SELECT version FROM migration").scan_row_max1(mversion); |
| 60 | if (!mversion) | 60 | if (!mversion) |
| 61 | throw std::runtime_error{"failed to fetch database migration version"}; | 61 | throw std::runtime_error{"failed to fetch database migration version"}; |
| 62 | if (mversion != schema::expected_version) | 62 | if (mversion != schema::expected_version) |