Skip to content

Commit

Permalink
remove gin indexes
Browse files Browse the repository at this point in the history
- closes #650
  • Loading branch information
ezekg committed Jul 23, 2022
1 parent 5819a45 commit 14147a5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class DropFingerprintGinIndexForMachines < ActiveRecord::Migration[7.0]
disable_ddl_transaction!

def change
remove_index :machines, :fingerprint, name: :index_machines_on_fingerprint, algorithm: :concurrently, using: :gin
end
end
7 changes: 7 additions & 0 deletions db/migrate/20220723044910_drop_email_gin_index_for_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class DropEmailGinIndexForUsers < ActiveRecord::Migration[7.0]
disable_ddl_transaction!

def change
remove_index :users, :email, name: :index_users_on_email, algorithm: :concurrently, using: :gin
end
end
4 changes: 1 addition & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2022_07_21_134635) do
ActiveRecord::Schema[7.0].define(version: 2022_07_23_044910) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gin"
enable_extension "pg_stat_statements"
Expand Down Expand Up @@ -232,7 +232,6 @@
t.index "to_tsvector('simple'::regconfig, COALESCE((name)::text, ''::text))", name: "machines_tsv_name_idx", using: :gist
t.index ["account_id", "created_at"], name: "index_machines_on_account_id_and_created_at"
t.index ["created_at"], name: "index_machines_on_created_at", order: :desc
t.index ["fingerprint"], name: "index_machines_on_fingerprint", using: :gin
t.index ["fingerprint"], name: "machines_hash_fingerprint_idx", using: :hash
t.index ["group_id"], name: "index_machines_on_group_id"
t.index ["id", "created_at", "account_id"], name: "index_machines_on_id_and_created_at_and_account_id", unique: true
Expand Down Expand Up @@ -612,7 +611,6 @@
t.index ["banned_at"], name: "index_users_on_banned_at"
t.index ["created_at"], name: "index_users_on_created_at", order: :desc
t.index ["email", "account_id"], name: "index_users_on_email_and_account_id", unique: true
t.index ["email"], name: "index_users_on_email", using: :gin
t.index ["group_id"], name: "index_users_on_group_id"
t.index ["id", "created_at", "account_id"], name: "index_users_on_id_and_created_at_and_account_id", unique: true
end
Expand Down

0 comments on commit 14147a5

Please sign in to comment.