Skip to content

v2.4.1 - Bug fixes

Latest

Choose a tag to compare

@b4oshany b4oshany released this 08 Jun 03:02
861d640

Summary

This migration update adds data cleanup logic to the down() method to ensure database integrity when rolling back the nullable constraint on the meta_value column in the app_metas table.

Changes

  • Added use Illuminate\Support\Facades\DB; import to support direct database operations
  • Added a data migration step in the down() method that converts any null meta_value entries to empty strings before removing the nullable constraint

Implementation Details

When rolling back this migration, the schema change attempts to convert meta_value from nullable to non-nullable. However, if any rows contain null values, this would fail. The new logic preemptively converts all null values to empty strings, ensuring the rollback can complete successfully.

This follows the package convention that meta_value is always stored as a string in the database, with the value accessor handling type restoration.

https://claude.ai/code/session_01Do5SwCFS4SihacyuMcCrgm

What's Changed

  • Ensure app_metas.meta_value is not null during rollback by @b4oshany in #8

Full Changelog: 2.4.0...2.4.1