From 069125de6ac42788bb8898835f4a9f012ba7d3e1 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Thu, 11 Jul 2024 06:26:15 +0200 Subject: [PATCH] fixed the hstore migration --- .../main-api/migrations/20240709000000_init_hstore.down.sql | 3 ++- server/main-api/migrations/20240709000000_init_hstore.up.sql | 3 ++- server/main-api/src/main.rs | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/main-api/migrations/20240709000000_init_hstore.down.sql b/server/main-api/migrations/20240709000000_init_hstore.down.sql index 4d4cfeea1..57837e1f0 100644 --- a/server/main-api/migrations/20240709000000_init_hstore.down.sql +++ b/server/main-api/migrations/20240709000000_init_hstore.down.sql @@ -1 +1,2 @@ -create extension IF NOT EXISTS hstore \ No newline at end of file +-- Add down migration script here +DROP EXTENSION IF EXISTS hstore diff --git a/server/main-api/migrations/20240709000000_init_hstore.up.sql b/server/main-api/migrations/20240709000000_init_hstore.up.sql index df7903e79..0fff9551a 100644 --- a/server/main-api/migrations/20240709000000_init_hstore.up.sql +++ b/server/main-api/migrations/20240709000000_init_hstore.up.sql @@ -1 +1,2 @@ - DROP EXTENSION IF EXISTS hstore \ No newline at end of file +-- Add up migration script here +create extension IF NOT EXISTS hstore diff --git a/server/main-api/src/main.rs b/server/main-api/src/main.rs index 85cce8b02..3b0283d5b 100644 --- a/server/main-api/src/main.rs +++ b/server/main-api/src/main.rs @@ -56,7 +56,7 @@ async fn health_status_handler(data: web::Data) -> HttpResponse { Some(hash) => format!("https://github.com/TUM-Dev/navigatum/tree/{hash}"), None => "unknown commit hash, probably running in development".to_string(), }; - return match data.pool.execute("SELECT 1").await { + match data.pool.execute("SELECT 1").await { Ok(_) => HttpResponse::Ok() .content_type("text/plain") .body(format!("healthy\nsource_code: {github_link}")), @@ -66,7 +66,7 @@ async fn health_status_handler(data: web::Data) -> HttpResponse { .content_type("text/plain") .body(format!("unhealthy\nsource_code: {github_link}")) } - }; + } } fn connection_string() -> String {