2016-01-11 46 views
0

當我通過遷移運行此查詢它提供了錯誤 - 當獲取問題運行遷移,而是通過控制檯其作品

查詢 -

ActionEvent.includes([:historic_task_allocation, {:task_results =>[:task_result_status, :user]}]).where("action_events.ae_type = 0 AND action_events.result_status <> 2 AND task_result_statuses.is_completion AND users.id NOT IN (SELECT user_id FROM allocation_user_links aul WHERE aul.task_allocation_id = task_allocations.id AND aul.valid_from < action_events.date AND (aul.valid_to > action_events.date OR aul.valid_to IS NULL))") 

錯誤 -

Mysql2::Error: Unknown column 'task_allocations.can_complete_late' in 'field list':

但通過控制檯的工作。

問題在哪裏?

+0

除了這個查詢之外,你還在做其他什麼嗎? – SteveTurczyn

回答

0

已解決此問題通過在self.up方法中的上面添加以下行中的查詢。

TaskAllocation.reset_column_information # Resets all the cached information about columns, which will cause them to be reloaded on the next request. 
相關問題