feat(migrate): add pending migrations function (#286)

This commit is contained in:
Samuel
2024-09-13 16:32:35 +02:00
committed by GitHub
parent 6ba176a175
commit 7d9ff7c98c
3 changed files with 96 additions and 0 deletions

View File

@@ -50,6 +50,12 @@ func TestExample(t *testing.T) {
reg.Add(migrate.CallComment, "3", log)
migrate.Callback = reg.Callback
pending, err := migrate.Pending(context.Background(), session, cql.Files)
if err != nil {
t.Fatal("Pending:", err)
}
t.Log("Pending migrations:", len(pending))
// First run prints data
if err := migrate.FromFS(context.Background(), session, cql.Files); err != nil {
t.Fatal("Migrate:", err)