Re:Salesforce enables ‘modify all’ in user profiles
by megous on Friday May 17, 2019 @08:36PM
(#19944860)
You can also do changes in the transaction and check that it did what you expected before committing.
[ Parent
| on HN ]
Re:Salesforce enables ‘modify all’ in user profiles
by SOLAR_FIELDS on Saturday May 18, 2019 @08:05AM
(#19946946)
Fair warning about this: if your transaction isolation level in your database is set to serialized hanging out in mid transaction while you verify your changes will block other calls to the table(s)!
I always recommend that you are wrapping calls in transactions if you are touching prod data. I only left the WHERE clause of my update query off once in my life before I started doing that.
Re:Salesforce enables ‘modify all’ in user profiles
by megous on Saturday May 18, 2019 @08:15AM
(#19946987)
If you fear this, you can put it into script like this:
BEGIN; UPDATE... SELECT for verification ROLLBACK;
And then just change ROLLBACK to COMMIT, after you're sattisfied. There's no need to do it interactively.
Re:Salesforce enables ‘modify all’ in user profiles
by PowerfulWizard on Friday May 17, 2019 @09:53PM
(#19945116)
That is smart, I would add "limit 2" to a single row update, so if it returns 2 rows updated I know it was wrong.