V47: Shop Localized Fields
Converts Shop module from separate translations JSONB to localized fields approach.
Changes
- Product fields (title, slug, description, body_html, seo_title, seo_description) change from VARCHAR/TEXT to JSONB maps
- Category fields (name, slug, description) change from VARCHAR/TEXT to JSONB maps
- Removes translations column from both tables
- Each field stores language → value map: %{"en" => "Product", "ru" => "Продукт"}
Migration Strategy
- Add temporary _new columns as JSONB
- Migrate canonical data with default language key from settings
- Merge existing translations into new fields
- Drop old columns, rename _new to original names
- Create GIN indexes for slug lookups
Rollback
Extracts default language values back to string columns and rebuilds the translations map from non-default language data.