Fix constraints on the database