Skip to content

2.7.1 — Scoped unique rules for composite indexes

Choose a tag to compare

@dejwCake dejwCake released this 04 Nov 17:52
· 3 commits to main since this release

Changes generated output only: regenerate a CRUD to pick up the new unique rules. Existing code is not touched.

Fixed

  • Generated columns (virtual/stored) are skipped when building a CRUD.
  • A unique index counts for a column only when that column is its last key column (deleted_at / deleted_unique ignored). Before, any column in a composite index got a unique rule.
  • Composite unique indexes generate a scoped rule: ->where('<col>', $this->input('<col>'…)) for each other key column, defaulting to the model's value on update.
  • Indexes containing a deleted_unique column are treated as soft-delete aware, not only ones named *deleted_at*.