Skip to content

Commit 39781ee

Browse files
committed
Nit: stricter version check (!= 0 instead of > 0)
The version shouldn't be negative, so it's equivalent; but I feel that `!= 0` better matches the intent ("only run this migration if the database is empty").
1 parent 50a1500 commit 39781ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

db/migrate/20200418113601_load_schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class LoadSchema < ActiveRecord::Migration
22
def up
3-
if ActiveRecord::Migrator.current_version > 0
3+
if ActiveRecord::Migrator.current_version != 0
44
raise StandardError, "The database schema is out of date; running this migration will cause irreversible data loss!"
55
end
66

0 commit comments

Comments
 (0)