fix completed_at index
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveSubmittersCompletedAtIndex < ActiveRecord::Migration[8.1]
|
||||
def up
|
||||
remove_index :submitters, %i[completed_at account_id], if_exists: true
|
||||
end
|
||||
|
||||
def down
|
||||
add_index :submitters, %i[completed_at account_id], if_not_exists: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSubmittersCompletedAtPartialIndex < ActiveRecord::Migration[8.1]
|
||||
def up
|
||||
add_index :submitters, %i[account_id completed_at], where: 'completed_at IS NOT NULL', if_not_exists: true
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :submitters, %i[account_id completed_at], if_exists: true
|
||||
end
|
||||
end
|
||||
+2
-2
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_05_06_121640) do
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_06_27_083558) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "btree_gin"
|
||||
enable_extension "pg_catalog.plpgsql"
|
||||
@@ -405,8 +405,8 @@ ActiveRecord::Schema[8.1].define(version: 2026_05_06_121640) do
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "uuid", null: false
|
||||
t.text "values", null: false
|
||||
t.index ["account_id", "completed_at"], name: "index_submitters_on_account_id_and_completed_at", where: "(completed_at IS NOT NULL)"
|
||||
t.index ["account_id", "id"], name: "index_submitters_on_account_id_and_id"
|
||||
t.index ["completed_at", "account_id"], name: "index_submitters_on_completed_at_and_account_id"
|
||||
t.index ["email"], name: "index_submitters_on_email"
|
||||
t.index ["external_id"], name: "index_submitters_on_external_id"
|
||||
t.index ["slug"], name: "index_submitters_on_slug", unique: true
|
||||
|
||||
Reference in New Issue
Block a user