-- 05_natural_key_bic_swift.sql
-- Banking Pattern Pack — PostgreSQL
-- Purpose: Natural keys: BIC/SWIFT for bank branches.
-- Context: Retail bank example with customers, accounts, transactions, cards, loans.
-- Date: 2025-08-18
-- Notes:
--   * Safe to read; run on a development DB.
--   * Requires: CREATE privileges; some files may need superuser for extensions.
--   * Search path set to 'bank' schema for clarity.
SET search_path = bank, public;

-- Natural key for branches using BIC (SWIFT)
ALTER TABLE bank.branches
  ADD CONSTRAINT branches_bic_unique UNIQUE (bic);
-- Already added in core; here we demonstrate relying on BIC as identifier in FKs.
