Drop-down menu with foreign key

Elzetia's profile image Elzetia posted 2 years ago in General Permalink

Hello,

I've added a foreign key that contains data. When I edit my values, it doesn't show me this menu. I can only edit manually.

Any ideas?

CREATE TABLE `item_group` (
    `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    `description` VARCHAR(255) NOT NULL COMMENT 'Description of Item Group' COLLATE 'utf8mb4_general_ci',
    PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1

INSERT INTO `item_group` (`id`, `description`) VALUES
    (1, 'default'),
    (2, 'drinks'),
    (3, 'foods'),
    (4, 'tools'),
    (5, 'weapons'),
    (6, 'ammo'),
    (7, 'documents'),
    (8, 'animals'),
    (9, 'valuables'),
    (10, 'horse');

ALTER TABLE `items`
    ADD COLUMN `groupId` INT UNSIGNED NOT NULL DEFAULT '1' COMMENT 'Item Group ID for Filtering' AFTER `id`,
    ADD CONSTRAINT `FK_items_item_group` FOREIGN KEY (`groupId`) REFERENCES `item_group` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION;
2 attachment(s):
  • Capture-d-cran-2023-08-05-040452
  • image
ansgar's profile image ansgar posted 2 years ago Permalink

Your second screenshot shows the foreign key drop-down, so I guess the first one is a custom query result?

Please login to leave a reply, or register at first.