Let us assume that we have a products table and a orders table. The products table have a primary key (tinyint) and the orders table have a primary key (int).
Try adding the foreign key:
alter table `products_orders`
add constraint `products_orders_products_id_foreign` foreign key (`products_id`)
references `products` (`id`) on delete cascade;
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint