(migrations, existingMigrations []*Migration, lastRun *Migration)
| 798 | } |
| 799 | |
| 800 | func ToCatchup(migrations, existingMigrations []*Migration, lastRun *Migration) []*PlannedMigration { |
| 801 | missing := make([]*PlannedMigration, 0) |
| 802 | for _, migration := range migrations { |
| 803 | found := false |
| 804 | for _, existing := range existingMigrations { |
| 805 | if existing.Id == migration.Id { |
| 806 | found = true |
| 807 | break |
| 808 | } |
| 809 | } |
| 810 | if !found && migration.Less(lastRun) { |
| 811 | missing = append(missing, &PlannedMigration{ |
| 812 | Migration: migration, |
| 813 | Queries: migration.Up, |
| 814 | DisableTransaction: migration.DisableTransactionUp, |
| 815 | }) |
| 816 | } |
| 817 | } |
| 818 | return missing |
| 819 | } |
| 820 | |
| 821 | func GetMigrationRecords(db *sql.DB, dialect string) ([]*MigrationRecord, error) { |
| 822 | return migSet.GetMigrationRecords(db, dialect) |
no test coverage detected
searching dependent graphs…