19 lines
452 B
Go
19 lines
452 B
Go
|
|
package main
|
||
|
|
|
||
|
|
import (
|
||
|
|
"testing"
|
||
|
|
|
||
|
|
"gorm.io/driver/sqlite"
|
||
|
|
"gorm.io/gorm"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestPrepareAdditiveMigrationsSkipsMissingLegacyTable(t *testing.T) {
|
||
|
|
databaseService, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{})
|
||
|
|
if err != nil {
|
||
|
|
t.Fatalf("open sqlite database: %v", err)
|
||
|
|
}
|
||
|
|
if err := prepareAdditiveMigrations(databaseService, "postgres"); err != nil {
|
||
|
|
t.Fatalf("missing legacy table should not require a backfill: %v", err)
|
||
|
|
}
|
||
|
|
}
|