-- 기존 테이블과 타입 삭제
DROP TABLE IF EXISTS performance_stats CASCADE;
DROP TABLE IF EXISTS user_payment_method_stats CASCADE;
DROP TABLE IF EXISTS user_monthly_spending CASCADE;
DROP TABLE IF EXISTS category_budgets CASCADE;
DROP TABLE IF EXISTS budgets CASCADE;
DROP TABLE IF EXISTS transactions CASCADE;
DROP TABLE IF EXISTS user_profiles CASCADE;

-- 기존 타입 삭제
DROP TYPE IF EXISTS transaction_type CASCADE;
DROP TYPE IF EXISTS payment_method CASCADE;
DROP TYPE IF EXISTS transaction_category CASCADE;
DROP TYPE IF EXISTS transaction_priority CASCADE;
DROP TYPE IF EXISTS budget_period CASCADE;
DROP TYPE IF EXISTS budget_status CASCADE;

-- 기존 함수 삭제
DROP FUNCTION IF EXISTS update_updated_at_column() CASCADE;
DROP FUNCTION IF EXISTS update_budget_status() CASCADE;
DROP FUNCTION IF EXISTS update_budget_on_transaction() CASCADE;
DROP FUNCTION IF EXISTS notify_transaction_changes() CASCADE;
DROP FUNCTION IF EXISTS notify_budget_changes() CASCADE;
DROP FUNCTION IF EXISTS hook_password_verification_attempt(jsonb) CASCADE;

-- 기존 뷰 삭제
DROP VIEW IF EXISTS user_monthly_spending CASCADE;
DROP VIEW IF EXISTS user_payment_method_stats CASCADE;