Skip to content

Comment on Ask HN: Strategies for not screwing up?parent

Comments

akorOP

That's essentially exactly what I did except when it threw an error I mistakenly substituted an AND in place of WHERE so the criteria were effectively ignored. We do run a stale version of the production database on staging but I didn't try running the SQL on it first so it wouldn't have helped. Do you run every destructive query against staging prior to production and then copy and past the FULL command?

It happens, just make sure you backup frequently. I am always nervous when directly modifying production databases. So, I take every precaution I can think of, even if it sounds like it will "obviously" work. Hopefully you will get to the point of not having to update the database manually very often, instead writing scripts that you know work.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.