Phase 0 Multitenant Prep - Planning Documentation
This directory contains all planning documentation for Phase 0 of the multitenant migration.
Documents
-
- Documents the decision to use
Autoch.atas the default tenant name
- Documents the decision to use
-
- Schema specification for the
tenantstable - Design decisions and rationale
- Schema specification for the
-
- Complete list of indexes required for
tenant_idcolumns - Composite index strategy for common query patterns
- Complete list of indexes required for
-
04-unique-constraint-migration.md
- Strategy for converting global unique constraints to tenant-scoped uniques
- SQL examples for each migration
-
- Detailed step-by-step migration order
- Rollback considerations for each phase
-
06-tenant-consistency-validation.md
- SQL queries to verify foreign key relationships maintain tenant consistency
- Comprehensive validation query
-
07-rls-policy-migration-strategy.md
- Before/after examples for all RLS policy replacements
- Complete policy migration guide for all tables
-
- 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.