Overview
This guide explains how to migrate from hardcoded enums to organization-scoped picklists using the PF-15 Picklist System.Why Migrate?
- Organization customization: Each org can customize values
- Admin UI management: Non-developers can add/edit options
- Color coding: Items can have associated colors for UI display
- Soft-delete: Items can be deactivated without breaking existing data
Migration Steps
1. Identify Enum Usage
Find all places where you’re using hardcoded enums:2. Create Picklist (Admin or Migration)
Either create via Admin UI or database migration:3. Use Backward-Compatible Hook
During migration, useusePicklistByEnum for backward compatibility:
4. Use PicklistSelector in Forms
Seeded Picklists
The following system picklists are automatically seeded:Best Practices
- Always use
usePicklistByEnumduring migration for backward compatibility - Mark system picklists with
is_system: trueto prevent accidental deletion - Use semantic picklist names that match the database enum names
- Include colors in metadata for status-type picklists