Skip to content

Commit

Permalink
Fix issue where bin/setup was not creating the test DB in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryguy committed Nov 21, 2023
1 parent ea4c1ca commit d8928ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ FileUtils.chdir APP_ROOT do
end

puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
if ENV["CI"]
system! 'RAILS_ENV=test bin/rails db:prepare'
else
system! 'bin/rails db:prepare'
end

puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
Expand Down
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
Expand Down

0 comments on commit d8928ea

Please sign in to comment.