Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] New table titles missing from "New Foreign Key" Referenced Table DropDown #1058

Open
sengratt opened this issue Feb 27, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@sengratt
Copy link

sengratt commented Feb 27, 2024

Given I create a new table using the Tables "+" icon and entering valid CREATE TABLE SQL:
When I assign the parent table user_id as PK
When I click the pencil icon on a child table containing field user_id:
When I click "Foreign Key" tab within the child table's Design Table option and observe the "New Foreign Key" modal:
Then the "Referenced Table" DropDown does not display the parent table containing user_id so that I can establish a FK relationship.

  • Database type and version:
    MariaDB 10+
@sengratt sengratt added the bug Something isn't working label Feb 27, 2024
@sengratt
Copy link
Author

A DB creation script I used defaulted to ISAM, preventing FK usage. A suggestion for your app would be to check for field mismatches of PK/FK data types, as well as incompatible database engines like ISAM. While InnoDB is recognized as a modern default, it might still confuse users since your app does not present any warnings, just silent omission of databases that are not foreign key compatible.

For example, if a table is ISAM, then you should mute the Foreign Key tab, or ghost it with a tool tip that explains the current database type does not support foreign keys.

Feel free to close this ticket after considering my suggestion. Thanks!

@cweijan
Copy link
Owner

cweijan commented Feb 27, 2024

Hi, the extension does not check the table's engine.

Did you open the design table view first and then create a new table? If so, this problem will be fixed in the next version.

@sengratt
Copy link
Author

sengratt commented Mar 1, 2024

Hello, yes, I believe I used the design table from my original comment: "Given I create a new table using the Tables "+" icon". Then I accessed the foreign key feature by clicking on the pencil icon. So I did not execute any manual ALTER SQL.

Hopefully users that are unaware of InnoDB vs. ISAM can benefit through your engine check in order to enable the Foreign Key feature. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants