really faster stats by precomputing some of them
This commit is contained in:
parent
f5f363ae99
commit
ad01d4dee5
5 changed files with 143 additions and 27 deletions
18
db/migrate/20201002124154_create_stats.rb
Normal file
18
db/migrate/20201002124154_create_stats.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
class CreateStats < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :stats do |t|
|
||||
t.bigint :dossiers_not_brouillon, default: 0
|
||||
t.bigint :dossiers_brouillon, default: 0
|
||||
t.bigint :dossiers_en_construction, default: 0
|
||||
t.bigint :dossiers_en_instruction, default: 0
|
||||
t.bigint :dossiers_termines, default: 0
|
||||
t.bigint :dossiers_depose_avant_30_jours, default: 0
|
||||
t.bigint :dossiers_deposes_entre_60_et_30_jours, default: 0
|
||||
|
||||
t.jsonb :dossiers_cumulative, null: false, default: '{}'
|
||||
t.jsonb :dossiers_in_the_last_4_months, null: false, default: '{}'
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue