[Docker] Fix initial setup

Since the correct database is now getting created on boot Rails does
things a bit different by trying to run migrations.
Also creates the test database since that wasn't automatic.
This commit is contained in:
Earlopain 2023-03-04 14:19:40 +01:00
parent 6776704560
commit b3c8608cee
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897

View File

@ -19,7 +19,10 @@ FileUtils.chdir APP_ROOT do
end
puts "\n== Preparing database =="
system! 'DANBOORU_DISABLE_THROTTLES=true bin/rails db:prepare'
# Create the test database, since only development exists at this point
system! 'RAILS_ENV=test bin/rails db:create'
system! 'RAILS_ENV=development bin/rails db:schema:load'
system! 'RAILS_ENV=development DANBOORU_DISABLE_THROTTLES=true bin/rails db:seed'
puts "\n== Preparing search indices =="
system! 'bin/rails r Post.__elasticsearch__.create_index!'