From eed3b1a4f3fd00f6fc2854de3549aaa28657f334 Mon Sep 17 00:00:00 2001 From: Jim Hodapp Date: Mon, 9 Dec 2024 11:57:45 -0600 Subject: [PATCH] Add an initial Admin platform user --- Dockerfile | 1 - docker-compose.yaml | 1 + entity_api/src/lib.rs | 16 ++++++++++++++++ migration/src/refactor_platform_rs.sql | 2 +- migration/src/setup_default_user.sql | 21 +++++++++++++++++++++ 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 migration/src/setup_default_user.sql diff --git a/Dockerfile b/Dockerfile index 6af9000..ffb8c98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,6 @@ FROM debian:stable-slim AS runtime RUN apt-get update && apt-get install -y \ libssl3 \ libpq5 \ - postgresql-client-15 \ bash \ && rm -rf /var/lib/apt/lists/* diff --git a/docker-compose.yaml b/docker-compose.yaml index df06552..da9fa5a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -13,6 +13,7 @@ services: - postgres_data:/var/lib/postgresql/data # Persist PostgreSQL data - ./migration/src/setup.sql:/docker-entrypoint-initdb.d/0-setup.sql # Initialize database with setup.sql - ./migration/src/refactor_platform_rs.sql:/docker-entrypoint-initdb.d/1-refactor_plaform_rs.sql # Initialize with refactor_platform_rs.sql + - ./migration/src/setup_default_user.sql:/docker-entrypoint-initdb.d/2-setup_default_user.sql # Initialize with setup_default_user.sql networks: - backend_network # Connect to backend_network diff --git a/entity_api/src/lib.rs b/entity_api/src/lib.rs index f0d6c14..479481e 100644 --- a/entity_api/src/lib.rs +++ b/entity_api/src/lib.rs @@ -31,6 +31,22 @@ pub(crate) fn naive_date_parse_str(date_str: &str) -> Result