[index] Add index on polls id and lock_version
This commit is contained in:
parent
002441af1f
commit
775439f194
7
db/migrate/20210117210100_add_index_on_polls.rb
Normal file
7
db/migrate/20210117210100_add_index_on_polls.rb
Normal file
@ -0,0 +1,7 @@
|
||||
class AddIndexOnPolls < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :polls, [:id, :lock_version], algorithm: :concurrently
|
||||
end
|
||||
end
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_01_17_120100) do
|
||||
ActiveRecord::Schema.define(version: 2021_01_17_210100) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
@ -571,6 +571,7 @@ ActiveRecord::Schema.define(version: 2021_01_17_120100) do
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "lock_version", default: 0, null: false
|
||||
t.index ["account_id"], name: "index_polls_on_account_id"
|
||||
t.index ["id", "lock_version"], name: "index_polls_on_id_and_lock_version"
|
||||
t.index ["status_id"], name: "index_polls_on_status_id"
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user