Drizzle Multi-Project Schema Issue
Setup: Monorepo with two packages sharing the same PostgreSQL
database:
database:
- database package: manages main application tables
- agents package: manages RAG-related tables with mastra_already_prefixConfiguration:
- Database package: tablesFilter: ["!mastra_*"] (exclude mastra
tables) - Agents package: tablesFilter: ["mastra_already_*"] (only managemastra tables)Problem:When running drizzle-kit push from the agents package, it tries toDROP database objects (like enum billing_period) that belong to thedatabase package, even though:
- The tablesFilter is configured to only manage mastraalready*
tables - drizzle-kit generate correctly produces SQL only for the filtered
tables (no DROP commands) - drizzle-kit introspect respects the filter (shows 0 tables, butstill fetches 7 enums)Error:error: cannot drop type billing_period because other objects depend on itdetail: 'column starting_price_period of table pricing depends on type billing_period'Expected: drizzle-kit push should only manage tables matching thetablesFilter pattern and ignore all other database objects (tables,enums, types) outside that scope.Question: Is this a known limitation? What's the recommendedapproach for multiple packages managing different tables in the samedatabase?