Skip to content

feat(migration-bundle): add collection-level selection and file filtering#302

Open
fefehun wants to merge 1 commit intodirectus-labs:mainfrom
fefehun:feature/collection-level-selection
Open

feat(migration-bundle): add collection-level selection and file filtering#302
fefehun wants to merge 1 commit intodirectus-labs:mainfrom
fefehun:feature/collection-level-selection

Conversation

@fefehun
Copy link

@fefehun fefehun commented Feb 24, 2026

Summary

This PR adds collection-level selection functionality to the migration-bundle extension, allowing users to select specific collections to migrate instead of migrating all content at once.

Addresses: #266, #294

Features Added

  • Collection-Level Selection: Users can now select specific collections for schema and content migration
  • File Filtering: Only files referenced by selected collections are migrated
  • Parent Group Auto-Inclusion: When child collections are selected, parent group collections are automatically included
  • Schema Option: Added "Schema" as a selectable migration option (previously always migrated)
  • Filtered System Data: Panels, flows, presets, and comments are now filtered based on collection references
  • Environment Variables:
    • MIGRATION_BUNDLE_SELECTED_COLLECTIONS
    • MIGRATION_BUNDLE_EXCLUDED_COLLECTIONS

Important Note: PostgreSQL Requirement

Due to a known Directus bug (#20428), schema migrations may fail on MySQL target instances. The bug causes char(36) to varchar(36) conversion which breaks MySQL foreign key constraints.

Recommendation: Use PostgreSQL for the target instance.

Target Database Schema Migration Status
PostgreSQL ✅ Works correctly Recommended
MySQL ⚠️ May fail with FK errors Known issue

Test Plan

  • Test migration with specific collections selected (schema + content)
  • Verify parent group collections are auto-included
  • Test file filtering with selected collections
  • Verify panels/flows/presets are filtered by collection
  • Test with PostgreSQL target instance

Development Note: This feature was developed with assistance from Claude Code (Anthropic's AI coding assistant).

🤖 Generated with Claude Code

…ring

- Add ability to select specific collections for schema and content migration
- Add file filtering based on selected collections
- Add parent group collection auto-inclusion
- Add Schema as selectable migration option
- Filter panels, flows, presets, and comments by collection
- Add environment variables: MIGRATION_BUNDLE_SELECTED_COLLECTIONS, MIGRATION_BUNDLE_EXCLUDED_COLLECTIONS
- Document PostgreSQL requirement for target instance (Directus Issue #20428)

Closes directus-labs#266, Closes directus-labs#294

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant