mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Add AhoyCaptain indexes
This commit is contained in:
7
db/migrate/20250609203830_create_ahoy_captain_indexes.rb
Normal file
7
db/migrate/20250609203830_create_ahoy_captain_indexes.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class CreateAhoyCaptainIndexes < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_index :ahoy_visits, :started_at unless index_exists?(:ahoy_visits, :started_at)
|
||||
add_index :ahoy_events, :visit_id unless index_exists?(:ahoy_events, :visit_id)
|
||||
add_index :ahoy_events, :time unless index_exists?(:ahoy_events, :time)
|
||||
end
|
||||
end
|
||||
4
db/schema.rb
generated
4
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_06_09_144356) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_06_09_203830) do
|
||||
create_schema "pganalyze"
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
@@ -25,6 +25,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_09_144356) do
|
||||
t.datetime "time"
|
||||
t.index ["name", "time"], name: "index_ahoy_events_on_name_and_time"
|
||||
t.index ["properties"], name: "index_ahoy_events_on_properties", opclass: :jsonb_path_ops, using: :gin
|
||||
t.index ["time"], name: "index_ahoy_events_on_time"
|
||||
t.index ["user_id"], name: "index_ahoy_events_on_user_id"
|
||||
t.index ["visit_id"], name: "index_ahoy_events_on_visit_id"
|
||||
end
|
||||
@@ -55,6 +56,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_09_144356) do
|
||||
t.string "os_version"
|
||||
t.string "platform"
|
||||
t.datetime "started_at"
|
||||
t.index ["started_at"], name: "index_ahoy_visits_on_started_at"
|
||||
t.index ["user_id"], name: "index_ahoy_visits_on_user_id"
|
||||
t.index ["visit_token"], name: "index_ahoy_visits_on_visit_token", unique: true
|
||||
t.index ["visitor_token", "started_at"], name: "index_ahoy_visits_on_visitor_token_and_started_at"
|
||||
|
||||
Reference in New Issue
Block a user