auto update foreign keys