mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
af3def0e2e
Previously, the accounting data were built on demand, extracting the data from the invoices on-the-fly. This is intended to be used only once in a while, so there was no performance issue with that. Now, we want those data to be accessed from the OpenAPI, so building them on-the-fly would be very much intensive and resouces heavy. So we build them each nights using a scheduled worker and save them in the database
25 lines
734 B
Ruby
25 lines
734 B
Ruby
# frozen_string_literal: true
|
|
|
|
# From this migration we save the accounting lines in database rather than building them on-the-fly.
|
|
# This will improve performance for API based requests
|
|
class CreateAccountingLines < ActiveRecord::Migration[5.2]
|
|
def change
|
|
create_table :accounting_lines do |t|
|
|
t.string :line_type
|
|
t.string :journal_code
|
|
t.datetime :date
|
|
t.string :account_code
|
|
t.string :account_label
|
|
t.string :analytical_code
|
|
t.references :invoice, foreign_key: true, index: true
|
|
t.references :invoicing_profile, foreign_key: true, index: true
|
|
t.integer :debit
|
|
t.integer :credit
|
|
t.string :currency
|
|
t.string :summary
|
|
|
|
t.timestamps
|
|
end
|
|
end
|
|
end
|