Bug 4972 Fix table creations failing due to foreign key checks