1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/db/migrate/20221118092948_create_accounting_lines.rb
Sylvain af3def0e2e (feat) save the accounting data in DB
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
2022-12-21 14:11:40 +01:00

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