# `PhoenixKit.Migrations.Postgres.V47`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.63/lib/phoenix_kit/migrations/postgres/v47.ex#L1)

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

1. Add temporary _new columns as JSONB
2. Migrate canonical data with default language key from settings
3. Merge existing translations into new fields
4. Drop old columns, rename _new to original names
5. 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.

# `down`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.63/lib/phoenix_kit/migrations/postgres/v47.ex#L320)

# `up`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.63/lib/phoenix_kit/migrations/postgres/v47.ex#L31)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
