Enhancement: Move reporting metrics to postgres (#606)

This commit is contained in:
Subin T P
2020-03-18 16:53:35 +05:30
committed by GitHub
parent f69eb7e542
commit 8f6f07177d
27 changed files with 575 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
class AddNotificationSettings < ActiveRecord::Migration[6.0]
def change
return if ActiveRecord::Base.connection.data_source_exists? 'notification_settings'
create_table :notification_settings do |t|
t.integer :account_id
t.integer :user_id

View File

@@ -0,0 +1,14 @@
class CreateEvents < ActiveRecord::Migration[6.0]
def change
create_table :events do |t|
t.string :name
t.float :value
t.integer :account_id
t.integer :inbox_id
t.integer :user_id
t.integer :conversation_id
t.timestamps
end
end
end

View File

@@ -0,0 +1,9 @@
class AddIndexToEvent < ActiveRecord::Migration[6.0]
def change
add_index :events, :name
add_index :events, :created_at
add_index :events, :account_id
add_index :events, :inbox_id
add_index :events, :user_id
end
end

View File

@@ -0,0 +1,7 @@
class AddIndexToMessage < ActiveRecord::Migration[6.0]
def change
add_index :messages, :account_id
add_index :messages, :inbox_id
add_index :messages, :user_id
end
end