We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04da1b6 commit 754bfd1Copy full SHA for 754bfd1
migrate/migration.go
@@ -291,12 +291,22 @@ func WithNopMigration() MigrationOption {
291
292
func sortAsc(ms MigrationSlice) {
293
sort.Slice(ms, func(i, j int) bool {
294
+ ni, ei := strconv.ParseInt(ms[i].Name, 10, 64)
295
+ nj, ej := strconv.ParseInt(ms[j].Name, 10, 64)
296
+ if ei == nil && ej == nil && ni != nj {
297
+ return ni < nj
298
+ }
299
return ms[i].Name < ms[j].Name
300
})
301
}
302
303
func sortDesc(ms MigrationSlice) {
304
305
306
307
308
+ return ni > nj
309
310
return ms[i].Name > ms[j].Name
311
312
0 commit comments