mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-74143 database: Make get_indexes() to return original column names
Sometimes, in order to provide a cross-db behaviour of unique indexes mixing null and not null columns, we create, under the hood, some function based indexes. When that happens get_indexes() is returning the name of the expression objects used to calculate that function index. But we need the original column names to be able to compare indexes and get column dependencies properly. So, this patch just looks, when the index is unique and function based, to the expressions (pretty standard CASE statements) and gets the original column name from it. Covered with tests.
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
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