Skip to content

migration: Add store package

Administrator requested to merge ef/migration-store into main

Created by: efritz

This PR adds a internal/database/migration/store package that contains a store for running migrations and managing migration state. Today, this re-implements the blocks of logic to mimmic golang-migrate:

  • Set the database version to the migration ID
  • Mark the database as dirty
  • Run the migration
  • Unmark the database as dirty

Additionally, we ensure that we're not skipping versions ahead or behind by ensuring that the current version is the expected one for the target migration direction. I'm not sure golang-migrate does this, so it's only added security.

Merge request reports

Loading