require('dotenv').config();const { createClient } = require('@supabase/supabase-js');const sb = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_KEY);(async()=>{console.log('Testing insert with minimal data...\n');try{const{data,error}=await sb.from('tasks').insert([{title:'TEST TASK',category:'test',description:'Test description',budget:100,max_workers:1,requester_id:'B2E46E',instructions:'test instructions',proof_label:'test'}]).select();if(error){console.log('❌ Insert Error:',error.message);console.log('Code:',error.code);return;}console.log('✅ Insert succeeded!');console.log('Data inserted:',data);const{data:check,error:checkErr}=await sb.from('tasks').select('*').limit(1);if(checkErr){console.log('Check error:',checkErr.message);return;}console.log('\n✅ Verification - Task exists:',check[0]?.title);}catch(err){console.error('Error:',err.message);}})();
