Skip to main content

Phase 0 Multitenant Prep - Planning Documentation

This directory contains all planning documentation for Phase 0 of the multitenant migration.

Documents

  1. 01-tenant-name-decision.md

    • Documents the decision to use Autoch.at as the default tenant name
  2. 02-tenants-table-design.md

    • Schema specification for the tenants table
    • Design decisions and rationale
  3. 03-index-planning.md

    • Complete list of indexes required for tenant_id columns
    • Composite index strategy for common query patterns
  4. 04-unique-constraint-migration.md

    • Strategy for converting global unique constraints to tenant-scoped uniques
    • SQL examples for each migration
  5. 05-migration-sequence.md

    • Detailed step-by-step migration order
    • Rollback considerations for each phase
  6. 06-tenant-consistency-validation.md

    • SQL queries to verify foreign key relationships maintain tenant consistency
    • Comprehensive validation query
  7. 07-rls-policy-migration-strategy.md

    • Before/after examples for all RLS policy replacements
    • Complete policy migration guide for all tables
  8. 08-migration-file-naming.md

    • File naming convention and sequence
    • Migration file structure standards

Usage

These documents guide the implementation of Phases 1-6:

  • Phase 1: Use documents 01, 02, 03, 05, 08
  • Phase 2: Use documents 01, 05, 06, 08
  • Phase 3: Use documents 05, 07, 08
  • Phase 4: Application code changes (not SQL migrations)
  • Phase 5: Use documents 03, 04, 05, 08

Reference

See MULTITENANT-SETUP.md for the overall multitenant redesign plan.