From b3c8608cee43ab0d5d8035490c55b03a63085333 Mon Sep 17 00:00:00 2001 From: Earlopain Date: Sat, 4 Mar 2023 14:19:40 +0100 Subject: [PATCH] [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. --- bin/setup | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/setup b/bin/setup index 9d3a21ca1..b5974a293 100755 --- a/bin/setup +++ b/bin/setup @@ -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!'