mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Fix database setup in dev-env
The postgres image does not come with pre-configured osem databases per environment. Calling db:create doesn't hurt if the databases already exist, so let's do it every time we bootstrap.
This commit is contained in:
parent
9c098e600b
commit
02f0fb078c
1 changed files with 1 additions and 1 deletions
|
|
@ -3,9 +3,9 @@
|
||||||
namespace :db do
|
namespace :db do
|
||||||
desc 'Bootstrap the database for the current RAILS_ENV (create, setup & seed if the database does not exist)'
|
desc 'Bootstrap the database for the current RAILS_ENV (create, setup & seed if the database does not exist)'
|
||||||
task bootstrap: :environment do
|
task bootstrap: :environment do
|
||||||
|
Rake::Task['db:create'].invoke
|
||||||
if ActiveRecord::Base.connection.tables.empty?
|
if ActiveRecord::Base.connection.tables.empty?
|
||||||
puts 'Bootstrapping the database...'
|
puts 'Bootstrapping the database...'
|
||||||
Rake::Task['db:create'].invoke
|
|
||||||
Rake::Task['db:setup'].invoke
|
Rake::Task['db:setup'].invoke
|
||||||
Rake::Task['db:seed'].invoke
|
Rake::Task['db:seed'].invoke
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue