3 ms·
Stored procedures are plaintext code running on production servers and is, in general, never cleanly redeployed. So by default they discourage source control. T
by tormeh 8y ago
Stored procedures are plaintext code running on production servers and is, in general, never cleanly redeployed. So by default they discourage source control. This is my primary problem with them. Also that (at least MySQL) has shitty error messages when you're trying to build/debug the things.
- ht85 8y agoMaintaining and migrating stored procedures can be a pain, especially when you're running a single tenant infrastructure, and even more if you don't migrate everyone at the same time. I've had a lot of success by creating a small build system for the database logic, that can be as simple as running a bunch of SQL files in order. The most important aspect is for the build to be "pure", rebuilding the whole thing every time instead of incrementally changing the schema. A practical way to do this is to have all your stored procedures in a separate schema from your data, and starting your build process with `DROP SCHEMA procs CASCADE`.