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

V46: Product Options with Dynamic Pricing + Import Logs + Translations

This migration adds:
- phoenix_kit_shop_config table for global Shop configuration
- option_schema JSONB column to categories for category-specific options
- image_id BIGINT column to categories for Storage media integration
- featured_image_id and image_ids columns to products for Storage integration
- selected_specs JSONB column to cart_items for specification storage
- phoenix_kit_shop_import_logs table for CSV import history tracking
- translations JSONB column to products and categories for multi-language support

## Option Schema Format

Options support dynamic pricing with two modifier types:

    %{
      "key" => "material",
      "label" => "Material",
      "type" => "select",
      "options" => ["PLA", "ABS", "PETG"],
      "affects_price" => true,
      "modifier_type" => "fixed",  # "fixed" or "percent"
      "price_modifiers" => %{
        "PLA" => "0",
        "ABS" => "5.00",
        "PETG" => "10.00"
      }
    }

## Price Calculation Order

1. Sum all fixed modifiers
2. Add to base price (intermediate price)
3. Sum all percent modifiers
4. Apply percent to intermediate price

Example: Base $20 + PETG ($10 fixed) + Premium (20% percent)
Result: ($20 + $10) * 1.20 = $36

# `down`

# `up`

---

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