Execute a set of migrations with an input context. Will apply at the target `version` of migration. Cannot be a negative value. Returns the number of applied migrations.
(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, version int64)
| 497 | // |
| 498 | // Returns the number of applied migrations. |
| 499 | func ExecVersionContext(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, version int64) (int, error) { |
| 500 | if version < 0 { |
| 501 | return 0, fmt.Errorf("target version %d should not be negative", version) |
| 502 | } |
| 503 | return migSet.ExecVersionContext(ctx, db, dialect, m, dir, version) |
| 504 | } |
| 505 | |
| 506 | // Returns the number of applied migrations. |
| 507 | func (ms MigrationSet) ExecMax(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) (int, error) { |
no test coverage detected
searching dependent graphs…