diff --git a/supabase/migrations/20260918030922_restore_result_column_writes.sql b/supabase/migrations/20260918030922_restore_result_column_writes.sql new file mode 100644 index 0000000..a094bf3 --- /dev/null +++ b/supabase/migrations/20260918030922_restore_result_column_writes.sql @@ -0,0 +1,9 @@ +begin; + +-- These columns were added after the original column-level result grants. +-- Browser submissions include them even when their values are null. +grant insert (runtime_flags, custom_runtime_id, revision), + update (runtime_flags, custom_runtime_id, revision) +on public.results to authenticated; + +commit; diff --git a/supabase/tests/database_smoke.sql b/supabase/tests/database_smoke.sql index 455b122..ec1ebdd 100644 --- a/supabase/tests/database_smoke.sql +++ b/supabase/tests/database_smoke.sql @@ -81,14 +81,23 @@ select public.update_rig( insert into public.results ( submitter_id, model_id, quant_id, runtime_id, runtime_version, rig_id, - component_id, component_quantity, decode_tps, repo_url, run_date + component_id, component_quantity, decode_tps, repo_url, run_date, + runtime_flags, custom_runtime_id, revision ) select current_setting('test.owner_id')::uuid, 'qwen3-8b', 'int4', 'cascadia', 'smoke', id, - 'intel-core-ultra-9-285k', 1, 42, 'https://github.com/labscommunity/cascadia', current_date + 'intel-core-ultra-9-285k', 1, 42, 'https://github.com/labscommunity/cascadia', current_date, + null, null, null from public.rigs where owner_id = current_setting('test.owner_id')::uuid and name = '__rls_smoke_rig__'; +-- The browser sends these columns for stock results too, including nulls. +update public.results +set runtime_flags = 'smoke flags', custom_runtime_id = null, revision = null +where submitter_id = current_setting('test.owner_id')::uuid + and runtime_version = 'smoke' + and rig_id = (select id from public.rigs where name = '__rls_smoke_rig__'); + do $$ begin begin