mysql – Foreign key constraint is incorrectly formed


So, i have these two tables

CREATE TABLE IF NOT EXISTS `inart_ps_categories` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `inart_ps_category_id` int(11) UNSIGNED NOT NULL,
  `parent_id` int(11) UNSIGNED DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  `num_children` int(11) DEFAULT '0',
  `flag` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;

CREATE TABLE IF NOT EXISTS `inart_ps_category_associations` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `inart_ps_category_id` int(11) UNSIGNED NOT NULL,
  `categoryid` int(11) NOT NULL,
  PRIMARY KEY (`id`),
    FOREIGN KEY (categoryid) REFERENCES `categories` (categoryid) ON DELETE CASCADE,
    FOREIGN KEY (inart_ps_category_id) REFERENCES `inart_ps_categories` (inart_ps_category_id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;

It outputs “Foreign key constraint is incorrectly formed” for no reason. The first Foreign key is correct and if i erase the second one, the query is executed. Can you see something wrong here?