migration: Rough sketch of migration runner validation
Created by: efritz
Note: This PR is meant to be behavior-preserving, and all of the new code should not be hit in product paths (see the validateOnly=false
argument values for all calls to connect
).
This PR adds some additional logic to the internal/database/live/connect
package. A new parameter will allow the connect
function to either
- Check the schema version and return an error if it's behind (what we'll end up wanting for all app startup once we guarantee the migrator has run), or
- Check the schema version and attempt to migrate it if it's behind (what we'll use in development and/or the migrator).