3 ms·
That's probably preferable to SQL stored procedures (which often live outside source control). Stored procs definitely have some big pros and big cons, bu
by JohnBooty 4y ago
That's probably preferable to SQL stored
procedures (which often live outside source control).
Stored procs definitely have some big pros and big cons, but I don't think this is one of them -- any ORM with a decent set of tools to manage migrations (ActiveRecord is one) makes this objection a non issue IMO.
- hamandcheese 4y agoI explicitly do not want to manage stored procedures in the same way as typical migrations - if I did, I would wind up with many, many versions of the procedure in my code base as it evolved over time. This would make grepping or locating the latest version pretty annoying. Flyway (migration tool in Java) has a notion of “repeatable” migrations, though, which would do the trick.
- JohnBooty 4y agoThis would make grepping or locating the latest version pretty annoying Wouldn't this be an issue with any database object managed via migrations? Do any of them make this easy for any database object? In ActiveRecord, you have your migrations folder(s) and then you have your `structure.sql` (essentially the raw output of mysqldump or pgdump) or the equivalent. If I need to see the literal database definition of any database object I look it up in there. Not the slickest solution but works well enough - really just a few keystrokes in my editor. I'd be curious how other migration tools handle (or fail to handle) this.
- hamandcheese 4y ago> Wouldn't this be an issue with any database object managed via migrations? Like I mentioned, check out flyway repeatable migrations.