MCPcopy
hub / github.com/dnote/dnote / initTestDBNoMigration

Function initTestDBNoMigration

pkg/cli/migrate/migrate_test.go:40–45  ·  view source on GitHub ↗

initTestDBNoMigration initializes a test database with schema.sql but removes migration version data so tests can control the migration state themselves.

(t *testing.T)

Source from the content-addressed store, hash-verified

38// initTestDBNoMigration initializes a test database with schema.sql but removes
39// migration version data so tests can control the migration state themselves.
40func initTestDBNoMigration(t *testing.T) *database.DB {
41 db := database.InitTestMemoryDBRaw(t, "")
42 // Remove migration versions from schema.sql so tests can set their own
43 database.MustExec(t, "clearing schema versions", db, "DELETE FROM system WHERE key IN (?, ?)", consts.SystemSchema, consts.SystemRemoteSchema)
44 return db
45}
46
47func TestExecute_bump_schema(t *testing.T) {
48 testCases := []struct {

Callers 4

TestExecute_bump_schemaFunction · 0.85
TestRun_nonfreshFunction · 0.85
TestRun_freshFunction · 0.85
TestRun_up_to_dateFunction · 0.85

Calls 2

InitTestMemoryDBRawFunction · 0.92
MustExecFunction · 0.92

Tested by

no test coverage detected