Skip to content

Commit

Permalink
Skip both primordial and main seeds then booting
Browse files Browse the repository at this point in the history
with environment variable.

It was just skipping half the seeds.

rename SKIP_PRIMORDIAL_SEED to SKIP_SEEDING
  • Loading branch information
kbrock committed Mar 14, 2017
1 parent c2f76e9 commit 31241cd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/evm_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ def self.seedable_model_class_names
end

def self.seed_primordial
if ENV['SKIP_PRIMORDIAL_SEED'] && MiqDatabase.count > 0
puts "** Primordial seedings is skipped."
puts "** Unset SKIP_PRIMORDIAL_SEED to re-enable"
if ENV['SKIP_SEEDING'] && MiqDatabase.count > 0
puts "** seedings is skipped on startup."
puts "** Unset SKIP_SEEDING to re-enable"
else
seed(PRIMORDIAL_CLASSES)
end
end

def self.seed_last
seed(seedable_model_class_names - PRIMORDIAL_CLASSES)
if ENV['SKIP_SEEDING'] && MiqDatabase.count > 0
seed(seedable_model_class_names - PRIMORDIAL_CLASSES)
end
end

def self.seed(classes = nil, exclude_list = [])
Expand Down

0 comments on commit 31241cd

Please sign in to comment.