cartodb-4.42/db/migrate/20161011074820_add_index_to_database_hosts.rb

17 lines
443 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
Sequel.migration do
no_transaction # indexes need to be created outside of the transaction
# This index is used for metrics gathering per database host. See #10115
up do
SequelRails.connection.run %{
CREATE INDEX CONCURRENTLY "users_database_host_index" ON "users" ("database_host");
}
end
down do
SequelRails.connection.run %{
DROP INDEX CONCURRENTLY IF EXISTS "users_database_host_index";
}
end
end