Skip to content

2.4.0

Choose a tag to compare

@BJNSTNKVC BJNSTNKVC released this 27 Sep 20:24
· 7 commits to master since this release

Added

  • Columns can be changed inside Schema.table with change(), as in table.string('nickname').nullable().change(). The new declaration replaces the old one where it stands, so a modifier left out is removed, including an index or unique index over that column alone.
  • A change may toggle nullable, add, change or remove a default, change the values an enum accepts, and add or remove index() and unique().
  • Existing rows are checked in the same migration. A column becoming required gives its default to rows without a value, and fails when it has no default. An enum dropping a value fails while rows still hold it. A new default fills rows missing the column. A unique index fails over repeated values. Any failure throws SchemaException naming the table, the column and the number of rows, and rolls the whole migration back.
  • Changing the key path, the type of a column or the scale of a decimal is refused with SchemaException.

Changed

  • Adding a unique index with table.unique() inside Schema.table over values that already repeat now throws SchemaException naming the columns, instead of IndexedDB's ConstraintError.