'bundle exec rake db:migrate' taking a long time due to calendar migration

discourse=# select count(*) from calendar_events where created_at > NOW()-INTERVAL '200 days';                                                                         
  count                                                                                                                                                                
----------                                                                                                                                                             
 25970368                                                                                                                                                              
(1 row)                                                                                                                                                                
                                                                                                                                                                       
discourse=# select count(*) from calendar_events where created_at > NOW()-INTERVAL '100 days';                                                                         
  count                                                                                                                                                                
----------                                                                                                                                                             
 14377700                                                                                                                                                              
(1 row)                                                                                                                                                                
                                                                                                                                                                       
discourse=# select count(*) from calendar_events where created_at > NOW()-INTERVAL '50 days';                                                                          
  count                                                                                                                                                                
---------                                                                                                                                                              
 7207939                                                                                                                                                               
(1 row)                                                                                                                                                                
                                                                                                                                                                       
discourse=# select count(*) from calendar_events where created_at > NOW()-INTERVAL '5 days';                                                                           
 count                                                                                                                                                                 
--------                                                                                                                                                               
 589938                                  
(1 row)                                                                                                 
iscourse=# select count(*) from calendar_events where created_at < NOW()-INTERVAL '200 days';
  count   
----------
 43754016
(1 row)