Skip to content

Commit e566b0f

Browse files
committed
fix filling migration versions
1 parent d454892 commit e566b0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/tasks/enju_leaf_tasks.rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ namespace :enju_leaf do
8787
20180107155817
8888
].include?(version)
8989

90-
next if ActiveRecord::Base.connection.exec_query('SELECT version FROM schema_migrations WHERE version = $1', 'SQL', [[nil, version]]).first
90+
next if ActiveRecord::Base.connection.select_one("SELECT version FROM schema_migrations WHERE version = '#{version.to_i}'")
9191

92-
ActiveRecord::Base.connection.exec_query('INSERT INTO schema_migrations (version) VALUES ($1)', 'SQL', [[nil, version]])
92+
ActiveRecord::Base.connection.execute("INSERT INTO schema_migrations (version) VALUES ('#{version.to_i}')")
9393
puts "Added #{entry[0]}"
9494
end
9595
end

0 commit comments

Comments
 (0)