From f3c9e1055a323847791ee882331172f28d9b19c1 Mon Sep 17 00:00:00 2001 From: lorinjameson Date: Wed, 25 Oct 2023 15:36:35 -0400 Subject: [PATCH] Fix for repeating DEFAULT_CONTEXT definitions --- create-default-groups.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/create-default-groups.js b/create-default-groups.js index 1b5e122..28e1133 100644 --- a/create-default-groups.js +++ b/create-default-groups.js @@ -291,11 +291,14 @@ const main = async (options) => { } // Make sure we have a DEFAULT_CONTEXT tag_definition - const tagCreateResp = await supabase.from('tag_definitions').upsert({ - name: 'DEFAULT_CONTEXT', - target_type: 'context', - scope: 'system', - }); + const tagCreateResp = await supabase.from('tag_definitions').upsert( + { + name: 'DEFAULT_CONTEXT', + target_type: 'context', + scope: 'system', + }, + { onConflict: 'name, target_type, scope' } + ); }; const optionDefinitions = [