PhoenixKit.Migrations.Postgres.V25 (phoenix_kit v1.7.62)

Copy Markdown View Source

PhoenixKit V25 Migration: Aspect Ratio Control for Dimensions

This migration adds support for aspect ratio preservation in dimension configuration. Allows users to choose between maintaining aspect ratio (width only) or fixed dimensions.

Changes

Storage Dimensions Table (phoenix_kit_storage_dimensions)

  • Adds maintain_aspect_ratio boolean column (default: true)
  • When true: Only width is used, height is calculated to preserve aspect ratio
  • When false: Both width and height are used as fixed dimensions (for thumbnails/crops)

Features

  • Aspect Ratio Mode: Responsive sizing with width-only specification
  • Fixed Dimension Mode: Exact pixel dimensions for square crops/thumbnails
  • Per-Dimension Control: Each variant can independently choose its mode
  • Default to Aspect Ratio: All dimensions default to maintaining aspect ratio

Summary

Functions

Rollback the V25 migration.

Run the V25 migration to add aspect ratio control.

Functions

down(opts)

Rollback the V25 migration.

up(opts)

Run the V25 migration to add aspect ratio control.