MCPcopy Create free account
hub / github.com/riverqueue/river / Migration

Function Migration

rivershared/testfactory/test_factory.go:139–149  ·  view source on GitHub ↗
(ctx context.Context, tb testing.TB, exec riverdriver.Executor, opts *MigrationOpts)

Source from the content-addressed store, hash-verified

137}
138
139func Migration(ctx context.Context, tb testing.TB, exec riverdriver.Executor, opts *MigrationOpts) *riverdriver.Migration {
140 tb.Helper()
141
142 migration, err := exec.MigrationInsertMany(ctx, &riverdriver.MigrationInsertManyParams{
143 Line: ptrutil.ValOrDefault(opts.Line, riverdriver.MigrationLineMain),
144 Schema: opts.Schema,
145 Versions: []int{ptrutil.ValOrDefaultFunc(opts.Version, nextSeq)},
146 })
147 require.NoError(tb, err)
148 return migration[0]
149}
150
151var seq int64 = 1 //nolint:gochecknoglobals
152

Callers 1

exerciseMigrationFunction · 0.92

Calls 4

ValOrDefaultFunction · 0.92
ValOrDefaultFuncFunction · 0.92
HelperMethod · 0.65
MigrationInsertManyMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…