mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Merge pull request #2225 from internetee/disable-pghero-migraiton-in-prod
disable pghero migration in prod
This commit is contained in:
commit
4e435b5999
1 changed files with 14 additions and 12 deletions
|
@ -1,15 +1,17 @@
|
|||
class CreatePgheroQueryStats < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :pghero_query_stats do |t|
|
||||
t.text :database
|
||||
t.text :user
|
||||
t.text :query
|
||||
t.integer :query_hash, limit: 8
|
||||
t.float :total_time
|
||||
t.integer :calls, limit: 8
|
||||
t.timestamp :captured_at
|
||||
end
|
||||
def change
|
||||
unless Rails.env.production?
|
||||
create_table :pghero_query_stats do |t|
|
||||
t.text :database
|
||||
t.text :user
|
||||
t.text :query
|
||||
t.integer :query_hash, limit: 8
|
||||
t.float :total_time
|
||||
t.integer :calls, limit: 8
|
||||
t.timestamp :captured_at
|
||||
end
|
||||
|
||||
add_index :pghero_query_stats, [:database, :captured_at]
|
||||
end
|
||||
add_index :pghero_query_stats, [:database, :captured_at]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue