chore: add migration 0007 for amount_aud + exchange_rate_to_aud columns
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
-- Add FX conversion support
|
||||||
|
ALTER TABLE statements ADD COLUMN IF NOT EXISTS exchange_rate_to_aud NUMERIC(10,6);
|
||||||
|
ALTER TABLE transactions ADD COLUMN IF NOT EXISTS amount_aud NUMERIC(12,2);
|
||||||
|
|
||||||
|
-- Backfill: all existing data is AUD
|
||||||
|
UPDATE transactions SET amount_aud = amount WHERE amount_aud IS NULL;
|
||||||
|
UPDATE statements SET exchange_rate_to_aud = 1.000000 WHERE exchange_rate_to_aud IS NULL;
|
||||||
Reference in New Issue
Block a user