HabitatMap/AirCasting

View on GitHub
db/migrate/20111202135732_fill_session_start_and_end_time.rb

Summary

Maintainability
A
0 mins
Test Coverage
class FillSessionStartAndEndTime < ActiveRecord::Migration[4.2]
  def up
    execute 'UPDATE sessions s SET start_time=(SELECT MIN(time) FROM measurements WHERE session_id=s.id), end_time=(SELECT MAX(time) FROM measurements WHERE session_id=s.id)'
  end

  def down; end
end