Enhancement: Move reporting metrics to postgres (#606)
This commit is contained in:
@@ -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
|
||||
14
db/migrate/20200310062527_create_events.rb
Normal file
14
db/migrate/20200310062527_create_events.rb
Normal 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
|
||||
9
db/migrate/20200310070540_add_index_to_event.rb
Normal file
9
db/migrate/20200310070540_add_index_to_event.rb
Normal 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
|
||||
7
db/migrate/20200311083854_add_index_to_message.rb
Normal file
7
db/migrate/20200311083854_add_index_to_message.rb
Normal 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
|
||||
Reference in New Issue
Block a user