diff --git a/migrate.go b/migrate.go index 465a96b..dcc4b29 100644 --- a/migrate.go +++ b/migrate.go @@ -21,9 +21,6 @@ const DefaultTableName = `version` // ErrUpdatesMissing indicates an update is missing, making it impossible to execute the migration var ErrUpdatesMissing = errors.New(`Missing migration files`) -// ErrDatabaseNewer indicates that the database version is newer than the requested version. We throw an error because downgrades might cause dataloss -var ErrDatabaseNewer = errors.New(`Current version is newer than the requested version`) - const fileFormat = `%04d.sql` // AssetFunc is a function that returns the data for the given name @@ -69,10 +66,6 @@ func Migrate(db *sql.DB, version int, o Options, asset AssetFunc) error { return err } - if v > version { - return ErrDatabaseNewer - } - for i := v + 1; i <= version; i++ { script, err := asset(fmt.Sprintf(o.AssetPrefix+fileFormat, i)) if err != nil {