Skip to content

Commit a388744

Browse files
committed
Fiexed:set ms.IgnoreUnknown true when length sqlFile is not 0
1 parent ed87383 commit a388744

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

migrate.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,8 @@ func (ms MigrationSet) PlanMigration(db *sql.DB, dialect string, m MigrationSour
582582

583583
// Make sure all migrations in the database are among the found migrations which
584584
// are to be applied.
585-
if !ms.IgnoreUnknown {
585+
// patch for special sql file: len(sqlFiles) == 0
586+
if !ms.IgnoreUnknown && len(sqlFiles) == 0 {
586587
migrationsSearch := make(map[string]struct{})
587588
for _, migration := range migrations {
588589
migrationsSearch[migration.Id] = struct{}{}

0 commit comments

Comments
 (0)