CREATE SINK alpheya_agent.party_clients_sink AS
SELECT
party_id,
display_name,
first_name,
last_name,
base_currency_code,
customer_relationship_status,
segment_label_id,
status_label_id,
onboarding_date,
updated_at
FROM alpheya_agent.book_of_business_party_clients_mv
WITH (
connector='postgres',
host='psql-nonprod-uae-derived.postgres.database.azure.com',
port='6432',
user='migration_user',
password='***',
database='ai-hub-int-alpheya-agent',
table='party_clients',
schema='derived',
type='upsert',
force_compaction='true',
primary_key='party_id'
)