Remove newer database check

This commit is contained in:
Nise Void 2018-07-04 13:41:59 +02:00
parent fdc83faba0
commit 0e43d5ed69
Signed by: NiseVoid
GPG Key ID: FBA14AC83EA602F3

View File

@ -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 {