forked from JetBrains/Exposed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: EXPOSED-50 customEnumeration reference column error (JetBrains#1785
) It is possible to to create a column with a reference to both EnumerationColumnType and EnumerationNameColumnType, but attempting to do so on a column created via customEnumeration() throws an NPE. This occurs when attempting to clone() the column with the custom database type, as the resulting column's kClass does not have a primary constructor. A primary constructor is needed to create a new instance and this is not provided by the anonymous object used as a type when the column is being registered. Extracting this object to its own CustomEnumerationColumnType means a valid KClass instance is provided to clone(), with a valid primary constructor. Add unit tests for all 3 types of enumeration columns with references. * fix: EXPOSED-50 customEnumeration reference column error Fix broken tests: - Shared table object is being altered differently in each unit test. New test that needs to create a unique index for referencing must have that unique index dropped by other unit tests. - MySQL tests require shared table object's unique index to only be added if it doesn't already exist (created by a previous test).
- Loading branch information
Showing
4 changed files
with
138 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters