Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boot skips all seeding with env variable #14207

Merged
merged 1 commit into from
Mar 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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