Fix: Profile Update Column Names (snake_case)

Branch: fix/profile-update-column-names Merged into: develop Date: 2026-03-17


Summary

Fixed a PostgREST PGRST204 error when saving a profile because the update payload used camelCase keys that don’t match the Supabase profiles table schema.


Error

PGRST204: Could not find the 'firstName' column of 'profiles' in the schema cache

Appeared 2 times in the app_issues Supabase table.


Root Cause

edit_profile_screen.dart built the updates map with camelCase keys:

final updates = {
  'firstName': _firstNameController.text.trim(),
  'lastName': _lastNameController.text.trim(),
  ...
};

The Supabase profiles table stores these as first_name / last_name (snake_case). PostgREST’s schema cache couldn’t find firstName and rejected the entire request.


Fix

Changed keys to snake_case in lib/features/profile/screens/edit_profile_screen.dart:

final updates = {
  'first_name': _firstNameController.text.trim(),
  'last_name': _lastNameController.text.trim(),
  ...
};

Note

This is a common footgun with Supabase + Flutter: the ORM layer doesn’t transform key casing automatically. Always verify column names match the database schema exactly. User.fromJson() (generated) already uses json['first_name'] and json['last_name'] — the update payload must use the same keys.