From e5658d1f61415054029b66cd2f703f1f40138460 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 18 Oct 2025 10:43:39 -0400 Subject: Add support for migration dependencies --- internal/bolttest/mock_migration_executor.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 internal/bolttest/mock_migration_executor.go (limited to 'internal/bolttest/mock_migration_executor.go') diff --git a/internal/bolttest/mock_migration_executor.go b/internal/bolttest/mock_migration_executor.go new file mode 100644 index 0000000..74eda4f --- /dev/null +++ b/internal/bolttest/mock_migration_executor.go @@ -0,0 +1,26 @@ +package bolttest + +import "git.sr.ht/~eugenetriguba/bolt/internal/models" + +type MockMigrationExecutor struct { + ApplyReturnValue ExecutorApplyReturnValue + ApplyCallCount int + RevertReturnValue ExecutorRevertReturnValue + RevertCallCount int +} + +type ExecutorApplyReturnValue struct { + Err error +} + +type ExecutorRevertReturnValue = ExecutorApplyReturnValue + +func (e *MockMigrationExecutor) Apply(migration *models.Migration) error { + e.ApplyCallCount++ + return e.ApplyReturnValue.Err +} + +func (e *MockMigrationExecutor) Revert(migration *models.Migration) error { + e.RevertCallCount++ + return e.RevertReturnValue.Err +} -- cgit v1.2.3