diff options
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) |