Only run public_data:pull
if there are no pending migrations
Oh this was a fun little dev environment bug: I ran `public_data:pull` on my laptop before migrating my database, so the `items` table pulled as the latest production version, which included the migrations, but they hadn't been marked as "run" yet. So Rails was still telling me I needed to run them, but the migrations themselves were crashing, with stuff like "there's already a column with this name!" This change ensures that `public_data:pull` won't run until migrations are done, to prevent silly accidents like that.
This commit is contained in:
parent
1acb00e35a
commit
4d24a9577f
1 changed files with 1 additions and 1 deletions
|
@ -63,7 +63,7 @@ namespace :public_data do
|
|||
end
|
||||
|
||||
desc "Pull and import the latest public data from production (dev only)"
|
||||
task :pull => :environment do
|
||||
task :pull => ["db:abort_if_pending_migrations", :environment] do
|
||||
unless Rails.env.development?
|
||||
raise "Can only pull public data in development mode! This helps us " +
|
||||
"ensure we won't overwrite the production database accidentally."
|
||||
|
|
Loading…
Reference in a new issue