Skip to content

Version-control Supabase schema: add migrations workflow (Supabase CLI) #31

Description

@syed-reza98

Why

Docs flag schema not version-controlled as a critical production risk (DB drift, no audit trail).

Goal

Introduce a migration workflow so schema changes are captured in-repo and reproducible.

Tasks

  • Add supabase/ directory (or migrations/) with pulled schema migrations
  • Document commands in README:
    • supabase migration pull
    • supabase db reset (local)
    • supabase db push
  • Add CI check that ensures migrations apply cleanly (optional: local DB in CI)
  • Add guidance for applying changes safely (breaking changes notes)

Acceptance criteria

  • A fresh clone can reproduce DB schema from migrations
  • Schema drift is detectable (PR diff shows SQL)

References

  • docs/01_CODEBASE_ARCHITECTURE_REVIEW.md: Schema not version-controlled (critical)
  • docs/02_FEATURES_REQUIREMENTS_BEST_PRACTICES.md: Issue 4 DB schema migrations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions