Error code: 1215: cannot add foreign key constraint
I have tried all options like changing the default storage engine using
SET default_storage_engine=ENGINE
But I'm unable to create this foreign key constraints. I'm using Mysql 5.5. Anybody can help me out.
create table if not exists pallets(
palletId serial,
goodsType varchar(25),
desitination varchar(25),
primary key (palletId)
);
create table if not exists storage(
id serial,
palletId integer,
primary key (id),
constraint FK _Pallet foreign key (palletId) REFERENCES pallets(palletId)
);