CRITICAL story-supabase-backend-core-global-admin-002 8 pts
8
Story Points
Critical
Priority
Supabase Backend Core
Feature

User Story

As a Global Administrator
I want to deploy database schema migrations via Supabase CLI with full version control in /supabase/migrations
So that So that all schema changes are auditable, reversible, and consistently applied across all environments without manual database interventions

Acceptance Criteria

  • Given a new migration file is added to /supabase/migrations, when the admin runs supabase db push, then the migration is applied to the target environment and recorded in the migrations table
  • Given multiple pending migrations exist, when the admin deploys, then migrations are applied in sequential order without skipping or reordering
  • Given a migration fails midway, when the admin checks migration status, then the failed migration is clearly identified and the database remains in its pre-migration state
  • Given the admin queries migration history, when viewing the supabase migrations table, then all applied migrations show timestamps, checksums, and success status
  • Given a new organization is being onboarded, when the admin provisions their database context, then the full schema is available with all RLS policies active

Business Value

Schema version control is critical for a multi-organization platform. Without it, schema drift between environments causes data integrity failures, broken API responses, and potential data loss. For a platform handling sensitive health and financial data across NHF, Blindeforbundet, and HLF, schema consistency is a compliance requirement.

Components