Table create fails
I am trying to add a new table to a local WordPress wpinventory db. I get the error message ERROR 1824: Failed to open the referenced table 'wp_wpinventory_item' see below, even though I can do a SELECT * wp_wpinventory_item.
Thanks - MySQL newbie but years of SqlServer.
Abbott
Operation failed: There was an error while applying the SQL script to the database.
Executing:
CREATE TABLE `abbott_wp6`.`kbo_inventorycategory` (
`inventorycategoy_id` INT NOT NULL AUTO_INCREMENT,
`inventory_id` INT NOT NULL,
`categoy_id` INT NOT NULL,
`category_type` VARCHAR(10) NOT NULL DEFAULT 'subject',
PRIMARY KEY (`inventorycategoy_id`),
INDEX `fk_inventorycatalog_inventory_idx` (`inventory_id` ASC) VISIBLE,
INDEX `fk_inventorycaegory_category_idx` (`categoy_id` ASC) VISIBLE,
CONSTRAINT `fk_inventorycategory_inventory`
FOREIGN KEY (`inventory_id`)
REFERENCES `abbott_wp6`.`wp_wpinventory_item` (`inventory_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_inventorycaegory_category`
FOREIGN KEY (`categoy_id`)
REFERENCES `abbott_wp6`.`wp_wpinventory_category` (`category_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
COMMENT = 'Has entries for each inventory item that point to its age, suject matter(s) and special catalog groups - teachers choice, bargains, new titles, under $2. Used to display age/subject(s) on inventory item page and list the various special catalogs.';
ERROR 1824: Failed to open the referenced table 'wp_wpinventory_item'
SQL Statement:
CREATE TABLE `abbott_wp6`.`kbo_inventorycategory` (
`inventorycategoy_id` INT NOT NULL AUTO_INCREMENT,
`inventory_id` INT NOT NULL,
`categoy_id` INT NOT NULL,
`category_type` VARCHAR(10) NOT NULL DEFAULT 'subject',
PRIMARY KEY (`inventorycategoy_id`),
INDEX `fk_inventorycatalog_inventory_idx` (`inventory_id` ASC) VISIBLE,
INDEX `fk_inventorycaegory_category_idx` (`categoy_id` ASC) VISIBLE,
CONSTRAINT `fk_inventorycategory_inventory`
FOREIGN KEY (`inventory_id`)
REFERENCES `abbott_wp6`.`wp_wpinventory_item` (`inventory_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_inventorycaegory_category`
FOREIGN KEY (`categoy_id`)
REFERENCES `abbott_wp6`.`wp_wpinventory_category` (`category_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
COMMENT = 'Has entries for each inventory item that point to its age, subject matter(s) and special catalog groups - teachers choice, bargains, new titles, under $2. Used to display age/subject(s) on inventory item page and list the various special catalogs.'