diff --git a/docs/BREAKING_CHANGES.md b/docs/BREAKING_CHANGES.md index e0ea00cca8..65bc4fd115 100644 --- a/docs/BREAKING_CHANGES.md +++ b/docs/BREAKING_CHANGES.md @@ -1,5 +1,28 @@ # Breaking Changes +## 0.43.0 + +* In all databases except MySQL, MariaDB, and SQL Server, the `ubyte()` column now maps to data type `SMALLINT` instead of `TINYINT`, which allows the full range of +`UByte` values to be inserted without any overflow. +Registering the column on a table also creates a check constraint that restricts inserted data to the range between 0 and `UByte.MAX_VALUE`. +If a column that only uses 1 byte of storage is needed, but without allowing any non-negative values to be inserted, please use a signed `byte()` column +instead with a manually created check constraint: +```kotlin +byte("number").check { it.between(0, Byte.MAX_VALUE) } +// OR +byte("number").check { (it greaterEq 0) and (it lessEq Byte.MAX_VALUE) } +``` +* In all databases except MySQL and MariaDB, the `uint()` column now maps to data type `BIGINT` instead of `INT`, which allows the full range of `UInt` values to +be inserted without any overflow. +Registering the column on a table also creates a check constraint that restricts inserted data to the range between 0 and `UInt.MAX_VALUE`. +If a column that only uses 4 bytes of storage is needed, but without allowing any non-negative values to be inserted, please use a signed `integer()` column +instead with a manually created check constraint: +```kotlin +integer("number").check { it.between(0, Int.MAX_VALUE) } +// OR +integer("number").check { (it greaterEq 0) and (it lessEq Int.MAX_VALUE) } +``` + ## 0.42.0 * [SQLite] The table column created using `date()` now uses TEXT datatype instead of DATE (which the database mapped internally to NUMERIC type). @@ -17,7 +40,7 @@ Please run `Edit -> Find -> Replace in files...` twice with `suspendedTransactio to ensure that both variants are replaced without affecting `suspendedTransactionAsync()` (if used in code). * The `repetitionAttempts` parameter in `transaction()` has been removed and replaced with a mutable property in the `Transaction` class. Please remove any arguments for this parameter and assign values to the property directly: -```kt +```kotlin // before transaction(Connection.TRANSACTION_READ_COMMITTED, repetitionAttempts = 10) { // statements @@ -34,9 +57,8 @@ values to be inserted without any overflow. Registering the column on a table also creates a check constraint that restricts inserted data to the range between 0 and `UShort.MAX_VALUE`. If a column that only uses 2 bytes of storage is needed, but without allowing any non-negative values to be inserted, please use a signed `short()` column instead with a manually created check constraint: -```kt +```kotlin short("number").check { it.between(0, Short.MAX_VALUE) } // OR short("number").check { (it greaterEq 0) and (it lessEq Short.MAX_VALUE) } ``` -