-- Rollback migration for Track 2-4 Schema

DROP TRIGGER IF EXISTS update_operator_roles_updated_at ON operator_roles;
DROP TRIGGER IF EXISTS update_analytics_flows_updated_at ON analytics_flows;
DROP TRIGGER IF EXISTS update_token_balances_updated_at ON token_balances;
DROP TRIGGER IF EXISTS update_addresses_updated_at ON addresses;

DROP FUNCTION IF EXISTS update_updated_at_column();

DROP TABLE IF EXISTS wallet_nonces;
DROP TABLE IF EXISTS operator_roles;
DROP TABLE IF EXISTS operator_ip_whitelist;
DROP TABLE IF EXISTS operator_events;
DROP MATERIALIZED VIEW IF EXISTS token_distribution;
DROP TABLE IF EXISTS analytics_bridge_history;
DROP TABLE IF EXISTS analytics_flows;
DROP TABLE IF EXISTS internal_transactions;
DROP TABLE IF EXISTS token_balances;
DROP TABLE IF EXISTS token_transfers;
DROP TABLE IF EXISTS addresses;

