rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.18k stars 270 forks source link

fix(planMigrate): Bad files are send when IgnoreUnknown is set #212

Open Mama59 opened 2 years ago

Mama59 commented 2 years ago

No get exising file on other folder if IgnoreUnknown is true

rubenv commented 2 years ago

@Mama59 Could you add a unit test that demonstrates what goes wrong here and what it fixes?

Mama59 commented 2 years ago

@Mama59 Could you add a unit test that demonstrates what goes wrong here and what it fixes?

@rubenv Test added, result without the change

----------------------------------------------------------------------
FAIL: migrate_test.go:669: SqliteMigrateSuite.TestMigrateWith2Folders

migrate_test.go:685:
    c.Assert(len(migrationsOtherPlanned), Equals, 1)
... obtained int = 0
... expected int = 1

OOPS: 35 passed, 1 FAILED
--- FAIL: Test (0.03s)
FAIL
exit status 1
FAIL    github.com/rubenv/sql-migrate   0.742s

Result with the change

OK: 36 passed
PASS
ok      github.com/rubenv/sql-migrate   0.861s