diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180626161807_index_web_hook_logs_created_at.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 20 insertions, 1 deletions
diff --git a/db/migrate/20180626161807_index_web_hook_logs_created_at.rb b/db/migrate/20180626161807_index_web_hook_logs_created_at.rb new file mode 100644 index 00000000000..1de9486b00e --- /dev/null +++ b/db/migrate/20180626161807_index_web_hook_logs_created_at.rb @@ -0,0 +1,18 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class IndexWebHookLogsCreatedAt < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index(:web_hook_logs, :created_at) + end + + def down + remove_concurrent_index(:web_hook_logs, :created_at) + end +end diff --git a/db/schema.rb b/db/schema.rb index 0112fc726d4..9e82047675d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180626125654) do +ActiveRecord::Schema.define(version: 20180626161807) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -2144,6 +2144,7 @@ ActiveRecord::Schema.define(version: 20180626125654) do t.datetime "updated_at", null: false end + add_index "web_hook_logs", ["created_at"], name: "index_web_hook_logs_on_created_at", using: :btree add_index "web_hook_logs", ["web_hook_id"], name: "index_web_hook_logs_on_web_hook_id", using: :btree create_table "web_hooks", force: :cascade do |t| |