Fix performance of percentile calculation for annual reports (#32765)
This commit is contained in:
parent
823f597f00
commit
90f4ffa31d
7 changed files with 77 additions and 47 deletions
|
@ -0,0 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateAnnualReportStatusesPerAccountCounts < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :annual_report_statuses_per_account_counts do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
||||
t.integer :year, null: false
|
||||
t.bigint :account_id, null: false
|
||||
t.bigint :statuses_count, null: false
|
||||
end
|
||||
|
||||
add_index :annual_report_statuses_per_account_counts, [:year, :account_id], unique: true
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue