Skip to content

Commit

Permalink
Add an index on BuildAttempt created_at
Browse files Browse the repository at this point in the history
Will be used in EnforceTimeoutsJob to select build attempts for a date
range.
  • Loading branch information
robolson committed Apr 8, 2016
1 parent d048809 commit 8405560
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class IndexCreatedAtOnBuildAttempts < ActiveRecord::Migration
def change
add_index :build_attempts, :created_at
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20151114185514) do
ActiveRecord::Schema.define(version: 20160408214135) do

create_table "branches", force: :cascade do |t|
t.integer "repository_id", limit: 4, null: false
Expand Down Expand Up @@ -45,6 +45,7 @@
end

add_index "build_attempts", ["build_part_id"], name: "index_build_attempts_on_build_part_id", using: :btree
add_index "build_attempts", ["created_at"], name: "index_build_attempts_on_created_at", using: :btree

create_table "build_parts", force: :cascade do |t|
t.integer "build_id", limit: 4
Expand Down

0 comments on commit 8405560

Please sign in to comment.