Add annual reports for accounts (#28693)
This commit is contained in:
parent
01ce9df880
commit
5b1eb09d54
21 changed files with 480 additions and 1 deletions
17
db/migrate/20240111033014_create_generated_annual_reports.rb
Normal file
17
db/migrate/20240111033014_create_generated_annual_reports.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateGeneratedAnnualReports < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :generated_annual_reports do |t|
|
||||
t.belongs_to :account, null: false, foreign_key: { on_cascade: :delete }, index: false
|
||||
t.integer :year, null: false
|
||||
t.jsonb :data, null: false
|
||||
t.integer :schema_version, null: false
|
||||
t.datetime :viewed_at
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :generated_annual_reports, [:account_id, :year], unique: true
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue