Fix performance of percentile calculation for annual reports (#32765)

This commit is contained in:
Eugen Rochko
2024-11-04 11:11:06 +01:00
committed by GitHub
parent 823f597f00
commit 90f4ffa31d
7 changed files with 77 additions and 47 deletions

View File

@@ -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