]> git.openstreetmap.org Git - rails.git/commitdiff
Use the db:create command for vagrant provisioning
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 31 May 2023 15:09:14 +0000 (16:09 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 31 May 2023 15:09:14 +0000 (16:09 +0100)
This is to align with the INSTALL.md instructions

script/vagrant/setup/provision.sh

index afabc48857535866304c6888553be361340f12ae..074a77277f58d84fee1ac8a2b82d2b7d5f6c01e2 100644 (file)
@@ -33,8 +33,6 @@ bundle exec bin/yarn install
 db_user_exists=`sudo -u postgres psql postgres -tAc "select 1 from pg_roles where rolname='vagrant'"`
 if [ "$db_user_exists" != "1" ]; then
     sudo -u postgres createuser -s vagrant
-    sudo -u vagrant createdb -E UTF-8 -O vagrant openstreetmap
-    sudo -u vagrant createdb -E UTF-8 -O vagrant osm_test
 fi
 
 # set up sample configs
@@ -45,6 +43,8 @@ if [ ! -f config/storage.yml ]; then
     cp config/example.storage.yml config/storage.yml
 fi
 touch config/settings.local.yml
+# create the databases
+sudo -u vagrant bundle exec rails db:create
 # migrate the database to the latest version
 sudo -u vagrant bundle exec rails db:migrate
 popd