mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 15:19:38 +02:00
Multi-currency part 1 (#542)
* Add family snapshots table * Add snapshot method, clean up family expected results * Remove old sync trigger
This commit is contained in:
parent
1cdf5ea6a7
commit
c60ddaec1d
9 changed files with 169 additions and 141 deletions
10
db/schema.rb
generated
10
db/schema.rb
generated
|
@ -10,11 +10,15 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_03_08_214956) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_03_09_180636) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
enable_extension "plpgsql"
|
||||
|
||||
# Custom types defined in this database.
|
||||
# Note that some types may not work with other database engines. Be careful if changing database.
|
||||
create_enum "account_status", ["ok", "syncing", "error"]
|
||||
|
||||
create_table "account_balances", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.uuid "account_id", null: false
|
||||
t.date "date", null: false
|
||||
|
@ -78,9 +82,11 @@ ActiveRecord::Schema[7.2].define(version: 2024_03_08_214956) do
|
|||
t.string "currency", default: "USD"
|
||||
t.decimal "converted_balance", precision: 19, scale: 4, default: "0.0"
|
||||
t.string "converted_currency", default: "USD"
|
||||
t.string "status", default: "OK"
|
||||
t.virtual "classification", type: :string, as: "\nCASE\n WHEN ((accountable_type)::text = ANY (ARRAY[('Account::Loan'::character varying)::text, ('Account::Credit'::character varying)::text, ('Account::OtherLiability'::character varying)::text])) THEN 'liability'::text\n ELSE 'asset'::text\nEND", stored: true
|
||||
t.boolean "is_active", default: true, null: false
|
||||
t.enum "status", default: "ok", null: false, enum_type: "account_status"
|
||||
t.jsonb "sync_warnings", default: "[]", null: false
|
||||
t.jsonb "sync_errors", default: "[]", null: false
|
||||
t.index ["accountable_type"], name: "index_accounts_on_accountable_type"
|
||||
t.index ["family_id"], name: "index_accounts_on_family_id"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue