[#3451] Added support for foreign key constraints