Skip to content

Commit 657ad25

Browse files
committed
Ensure migration can run from a fresh db.
1 parent 95fe87d commit 657ad25

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

db/migrate/20150803044346_data_add_benchmark_result_type_id_to_benchmark_runs.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ def up
44
ruby_benchmark_types = Repo
55
.joins(:organization)
66
.where('repos.name = ? AND organizations.name = ?', 'ruby', 'ruby')
7-
.first
8-
.benchmark_types
7+
.first&.benchmark_types
8+
9+
return if ruby_benchmark_types.empty?
910

1011
benchmark_result_type = BenchmarkResultType.create!(
1112
name: 'Execution time', unit: 'Seconds'

0 commit comments

Comments
 (0)