diff --git a/prisma/migrations/0007_cashflow/migration.sql b/prisma/migrations/0007_cashflow/migration.sql new file mode 100644 index 0000000..5d721f7 --- /dev/null +++ b/prisma/migrations/0007_cashflow/migration.sql @@ -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;