-- 06_unique_constraints_customers.sql
-- Banking Pattern Pack — PostgreSQL
-- Purpose: UNIQUE constraints on customer emails/phone.
-- 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;

-- UNIQUE constraints help deduplicate contacts
ALTER TABLE bank.customers
  ADD CONSTRAINT customers_email_unique UNIQUE (email);
ALTER TABLE bank.customers
  ADD CONSTRAINT customers_phone_unique UNIQUE (phone);
