From 433f19ae123c856112e328b8958c4cfc33638947 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 8 Dec 2023 15:09:52 -0800 Subject: [PATCH] Fix api_set_context migration. Fix non-unique key code smell. --- app/src/features/surveys/components/SamplingMethodForm.tsx | 4 ++-- .../src/migrations/20231207000001_update_api_set_context.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/features/surveys/components/SamplingMethodForm.tsx b/app/src/features/surveys/components/SamplingMethodForm.tsx index 59e5baaf21..e543b49318 100644 --- a/app/src/features/surveys/components/SamplingMethodForm.tsx +++ b/app/src/features/surveys/components/SamplingMethodForm.tsx @@ -138,7 +138,7 @@ const SamplingMethodForm = () => { )} {values.methods.map((item, index) => ( - + { {item.periods.map((period) => ( diff --git a/database/src/migrations/20231207000001_update_api_set_context.ts b/database/src/migrations/20231207000001_update_api_set_context.ts index 655251b09a..26baeb8037 100644 --- a/database/src/migrations/20231207000001_update_api_set_context.ts +++ b/database/src/migrations/20231207000001_update_api_set_context.ts @@ -9,6 +9,8 @@ import { Knex } from 'knex'; */ export async function up(knex: Knex): Promise { await knex.raw(` + SET search_path = 'biohub'; + DROP FUNCTION IF EXISTS api_set_context; CREATE OR REPLACE FUNCTION api_set_context(p_system_user_guid system_user.user_guid%type, p_user_identity_source_name user_identity_source.name%type) RETURNS system_user.system_user_id%type