Skip to content

Add Select2 to relation view dropdowns and auto-select foreign table - #20357

Open
strtob wants to merge 1 commit into
phpmyadmin:QA_5_2from
strtob:relation-autoselect-5.2.1
Open

Add Select2 to relation view dropdowns and auto-select foreign table#20357
strtob wants to merge 1 commit into
phpmyadmin:QA_5_2from
strtob:relation-autoselect-5.2.1

Conversation

@strtob

@strtob strtob commented Jul 5, 2026

Copy link
Copy Markdown

Description

The plain dropdowns in the table Relation view (database/table/column selectors for internal relations and foreign key constraints) are replaced with Select2 widgets, so the related table can be found with a search field instead of scrolling through one long dropdown list.

Fixes #18031

Additionally, when a source column that follows the <table>_id naming convention is selected (e.g. tbl_property_id or property_id, while a table tbl_property/property exists), the foreign table is selected automatically and its primary key column is preselected.

Select2 4.0.13 (MIT licensed) is bundled under js/vendor/select2/.

Note: this targets the 5.2 codebase (QA_5_2 branch). I am happy to port it to master (select2 via yarn/webpack instead of bundled vendor files) if you would prefer to land this in 6.0.

A demo GIF follows in a comment below.

The dropdowns in the "Relation view" (database/table selectors for
internal relations and foreign key constraints) are replaced with
Select2 widgets, so the related table can be found with a search
field instead of scrolling through a long plain dropdown.

Additionally, when a source column following the <table>_id naming
convention is selected (e.g. tbl_property_id or property_id and a
table tbl_property/property exists), the foreign table is selected
automatically and its primary key column is preselected.

Fixes phpmyadmin#18031

Signed-off-by: STRATON REA <streckelt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant