BRACKETS-by-TRIAD / craftable-pro-docs

Craftable PRO is an admin panel for your Laravel project build with InertiaJS, Vue and TailwindCSS.
https://docs.craftable.pro
MIT License
7 stars 1 forks source link

Non-integer columns are not shown as options to select when asked for foreign key and primary key when adding relation #91

Open hfoletto opened 4 months ago

hfoletto commented 4 months ago

Hello there!

When using the craftable-pro:generate-crud artisan command, I have the ability to add a relation. It then asks me the name of the related model, and after that the keys.

Here's the problem: For the "What is the foreign key column in {ModelName} model?" and "What is the referenced primary key column in {RelatedModelName} model?", only columns that the types are int or bitint are shown.
This creates a problem for me, because I'm using a VARCHAR type for the primary key for a few tables in my application.
UUID (and variations) are also common, for those cases, people usually use CHAR or BINARY, so it wouldn't show up as a choice when using the craftable-pro:generate-crud artisan command.

Thank you!