MCPcopy Index your code
hub / github.com/dnote/dnote / TestMigrate_createsSchemaTable

Function TestMigrate_createsSchemaTable

pkg/server/database/migrate_test.go:55–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53}
54
55func TestMigrate_createsSchemaTable(t *testing.T) {
56 db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{})
57 if err != nil {
58 t.Fatalf("failed to open database: %v", err)
59 }
60
61 migrationsFs := fstest.MapFS{}
62 migrate(db, migrationsFs)
63
64 // Verify schema_migrations table exists
65 var count int64
66 if err := db.Raw("SELECT COUNT(*) FROM schema_migrations").Scan(&count).Error; err != nil {
67 t.Fatalf("schema_migrations table not found: %v", err)
68 }
69}
70
71func TestMigrate_idempotency(t *testing.T) {
72 db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{})

Callers

nothing calls this directly

Calls 2

migrateFunction · 0.85
OpenMethod · 0.80

Tested by

no test coverage detected