summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-09-10 13:27:51 +0200
committerSanto Cariotti <santo@dcariotti.me>2024-09-10 13:27:51 +0200
commita1ef3b1e7ef495864f98ed45ef398441be26e6da (patch)
tree51760054207f518492a406ba33d3fdf8fac58ddb
parent07dc779a4a21bb6f90f048712becd89f0f1eff85 (diff)
Remove `OnFoot` moving activity
-rw-r--r--schema/init.sql2
-rw-r--r--src/graphql/types/position.rs5
2 files changed, 1 insertions, 6 deletions
diff --git a/schema/init.sql b/schema/init.sql
index 9a6abee..7397619 100644
--- a/schema/init.sql
+++ b/schema/init.sql
@@ -9,7 +9,7 @@ CREATE TABLE users(
PRIMARY KEY (id)
);
-CREATE TYPE moving_activity AS ENUM ('InVehicle', 'OnFoot', 'Running', 'Walking', 'Still');
+CREATE TYPE moving_activity AS ENUM ('InVehicle', 'Running', 'Walking', 'Still');
CREATE TABLE positions(
id SERIAL NOT NULL,
diff --git a/src/graphql/types/position.rs b/src/graphql/types/position.rs
index a06af6c..22030c5 100644
--- a/src/graphql/types/position.rs
+++ b/src/graphql/types/position.rs
@@ -12,9 +12,6 @@ pub enum MovingActivity {
// "Car" of the doc
InVehicle,
- // Walking or running
- OnFoot,
-
// Running
Running,
@@ -29,7 +26,6 @@ impl<'a> FromSql<'a> for MovingActivity {
fn from_sql(_ty: &Type, raw: &'a [u8]) -> Result<MovingActivity, Box<dyn Error + Sync + Send>> {
match std::str::from_utf8(raw)? {
"InVehicle" => Ok(MovingActivity::InVehicle),
- "OnFoot" => Ok(MovingActivity::OnFoot),
"Running" => Ok(MovingActivity::Running),
"Walking" => Ok(MovingActivity::Walking),
"Still" => Ok(MovingActivity::Still),
@@ -50,7 +46,6 @@ impl ToSql for MovingActivity {
) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
let value = match *self {
MovingActivity::InVehicle => "InVehicle",
- MovingActivity::OnFoot => "OnFoot",
MovingActivity::Running => "Running",
MovingActivity::Walking => "Walking",
MovingActivity::Still => "Still",