Skip to content

Commit 2de5a20

Browse files
authored
Fix warning for negative range (#129)
Quick fix for the following warning ``` warning: Range.new/2 and first..last default to a step of -1 when last < first. Use Range.new(first, last, -1) or first..last//-1, or pass 1 if that was your intention ``` This happens when rolling back the migrations (dev) or when removing `error_tracker` (prod)
1 parent 94beaac commit 2de5a20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/error_tracker/migration/sql_migrator.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defmodule ErrorTracker.Migration.SQLMigrator do
2424
initial = max(current_version(opts), initial_version)
2525

2626
if initial >= opts.version do
27-
change(migrator, initial..opts.version, :down, opts)
27+
change(migrator, initial..opts.version//-1, :down, opts)
2828
end
2929
end
3030

0 commit comments

Comments
 (0)