3 ms·
Using a migration utility like ActiveRecord, Flyway, or go-pg, SQL definitions can also live in version control, have automatic tests, and deploy automatically.
by mdavidn 5y ago
Using a migration utility like ActiveRecord, Flyway, or go-pg, SQL definitions can also live in version control, have automatic tests, and deploy automatically. Who has a database in production without these things?
- throw1234651234 5y agoUnrelated, but which ones of these do you recommend (also factor in LiquiBase) that's free? As far as automatic tests for dbs - I have no idea what you are talking about unless you mean integration testing through a backend.
- mdavidn 5y agoI’d recommend whichever one is available in a language the project uses already. Automatic tests for a database could simply be writes followed by reads with expectations for the returned rows. This is how Postgres tests itself. My personal go-to right now is ActiveRecord and RSpec. The examples could just as easily run raw SQL directly using the Ruby pg driver.