CREATE SINK insights.investment_accounts_ft_sink AS
SELECT
account_id,
fact_date,
purchasing_power,
purchasing_power_system_currency,
disabled_at
FROM insights.investment_account_purchasing_power_mv
WHERE
disabled_at IS NULL
WITH (
connector='postgres',
host='psql-nonprod-uae-derived.postgres.database.azure.com',
port='6432',
user='migration_user',
password='***',
database='adib-int-insights-db',
table='investment_accounts_ft',
schema='insights',
type='upsert',
force_compaction='true',
primary_key='account_id,fact_date'
)