Skip to content

Commit

Permalink
Replace Heroku-specific Rake tasks with db:prepare now that Demo is…
Browse files Browse the repository at this point in the history
… upgraded to Rails 7.1 (#1120)
  • Loading branch information
bensheldon authored Oct 20, 2023
1 parent faf7c29 commit 575d7b0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
release: bin/rails heroku:release
release: bin/rails db:prepare
web: bin/rails server
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
}
],
"scripts": {
"postdeploy": "bin/rails heroku:postdeploy"
"postdeploy": "bin/rails db:prepare"
}
}
18 changes: 0 additions & 18 deletions spec/test_app/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@ require_relative 'config/application'

Rails.application.load_tasks

namespace :heroku do
desc 'Heroku release tasks (runs on every code push, before postdeploy task on review app creation)'
task release: :environment do
unless ActiveRecord::SchemaMigration.table_exists?
Rails.logger.info "Database not initialized, skipping release tasks..."
next
end

Rake::Task['db:migrate'].invoke
end

desc 'Heroku postdeploy tasks (runs only on review app creation, after release task)'
task postdeploy: :environment do
Rake::Task['db:schema:load'].invoke
Rake::Task['db:seed'].invoke
end
end

def remove_version_from_schema_rb
puts "GoodJob: Sanitizing Rails version from schema.rb...\n"
schema_rb = Rails.root.join("db/schema.rb").to_s
Expand Down

0 comments on commit 575d7b0

Please sign in to comment.