Updated to use the "resource" terminology in foreign keys.