# Schema Design Analysis - 20251123-124312 == Tables Created == /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:4:CREATE TABLE IF NOT EXISTS refresh_tokens ( /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:27:CREATE TABLE IF NOT EXISTS superuser_transfers ( /home/administrator/projects/coppertone.tech/backend/migrations/008_csrf_tokens.up.sql:4:CREATE TABLE IF NOT EXISTS csrf_tokens ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:9:CREATE TABLE IF NOT EXISTS payment_networks ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:31:CREATE TABLE IF NOT EXISTS payment_tokens ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:69:CREATE TABLE IF NOT EXISTS payment_wallets ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:103:CREATE TABLE IF NOT EXISTS payment_gateways ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:140:CREATE TABLE IF NOT EXISTS payment_gateway_currencies ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:170:CREATE TABLE IF NOT EXISTS payment_crypto_details ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:213:CREATE TABLE IF NOT EXISTS payment_audit_log ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:239:CREATE TABLE IF NOT EXISTS donation_campaigns ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:288:CREATE TABLE IF NOT EXISTS donations ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:336:CREATE TABLE IF NOT EXISTS donation_tiers ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:364:CREATE TABLE IF NOT EXISTS exchange_rates ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:375:CREATE TABLE IF NOT EXISTS exchange_rates_history ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:389:CREATE TABLE IF NOT EXISTS subscription_plans ( /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:411:CREATE TABLE IF NOT EXISTS subscriptions ( /home/administrator/projects/coppertone.tech/backend/migrations/005_schema_separation.up.sql:55: 'CREATE TABLE IF NOT EXISTS %I.%I (LIKE public.%I INCLUDING ALL)', /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:5:CREATE TABLE IF NOT EXISTS invoices ( /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:38:CREATE TABLE IF NOT EXISTS payments ( /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:64:CREATE TABLE IF NOT EXISTS invoice_items ( /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:2:CREATE TABLE IF NOT EXISTS users ( /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:17:CREATE TABLE IF NOT EXISTS identities ( /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:39:CREATE TABLE IF NOT EXISTS user_roles ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:5:CREATE TABLE IF NOT EXISTS messenger_profiles ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:19:CREATE TABLE IF NOT EXISTS messenger_keys ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:34:CREATE TABLE IF NOT EXISTS messenger_contacts ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:53:CREATE TABLE IF NOT EXISTS messenger_contact_groups ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:67:CREATE TABLE IF NOT EXISTS messenger_blocklist ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:82:CREATE TABLE IF NOT EXISTS messenger_conversations ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:99:CREATE TABLE IF NOT EXISTS messenger_conversation_members ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:116:CREATE TABLE IF NOT EXISTS messenger_messages ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:141:CREATE TABLE IF NOT EXISTS messenger_read_receipts ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:150:CREATE TABLE IF NOT EXISTS messenger_peer_registry ( /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:168:CREATE TABLE IF NOT EXISTS messenger_relay_nodes ( /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:5:CREATE TABLE IF NOT EXISTS projects ( /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:27:CREATE TABLE IF NOT EXISTS tasks ( /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:50:CREATE TABLE IF NOT EXISTS work_orders ( /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:68:CREATE TABLE IF NOT EXISTS task_comments ( /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:67:CREATE TABLE IF NOT EXISTS audit_log ( /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:92:CREATE TABLE IF NOT EXISTS project_approval_comments ( == Foreign Key Constraints == /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:6: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:29: from_user_id INTEGER NOT NULL REFERENCES users(id), /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:30: to_user_id INTEGER NOT NULL REFERENCES users(id), /home/administrator/projects/coppertone.tech/backend/migrations/008_csrf_tokens.up.sql:6: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:33: network_id INTEGER NOT NULL REFERENCES payment_networks(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:43: verified_by INTEGER REFERENCES users(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:72: network_id INTEGER NOT NULL REFERENCES payment_networks(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:142: gateway_id INTEGER NOT NULL REFERENCES payment_gateways(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:172: payment_id INTEGER NOT NULL REFERENCES payments(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:175: network_id INTEGER REFERENCES payment_networks(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:176: token_id INTEGER REFERENCES payment_tokens(id), -- NULL for native currency /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:215: payment_id INTEGER REFERENCES payments(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:216: invoice_id INTEGER REFERENCES invoices(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:225: performed_by INTEGER REFERENCES users(id), -- NULL for system actions /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:282: created_by INTEGER REFERENCES users(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:293: campaign_id INTEGER REFERENCES donation_campaigns(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:296: donor_id INTEGER REFERENCES users(id) ON DELETE SET NULL, -- NULL for anonymous /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:308: payment_id INTEGER REFERENCES payments(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:313: network_id INTEGER REFERENCES payment_networks(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:314: token_id INTEGER REFERENCES payment_tokens(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:338: campaign_id INTEGER NOT NULL REFERENCES donation_campaigns(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:415: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:416: plan_id INTEGER NOT NULL REFERENCES subscription_plans(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:421: gateway_id INTEGER REFERENCES payment_gateways(id), /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:8: project_id INTEGER REFERENCES projects(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:9: client_id INTEGER NOT NULL REFERENCES users(id) ON DELETE RESTRICT, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:40: invoice_id INTEGER NOT NULL REFERENCES invoices(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:66: invoice_id INTEGER NOT NULL REFERENCES invoices(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:19: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:41: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:7: user_id INTEGER NOT NULL UNIQUE REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:21: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:36: owner_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:37: contact_user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:55: owner_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:69: owner_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:70: blocked_user_id INTEGER REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:88: owner_id INTEGER REFERENCES users(id) ON DELETE SET NULL, -- Creator/admin /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:101: conversation_id UUID NOT NULL REFERENCES messenger_conversations(conversation_id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:102: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:105: invited_by INTEGER REFERENCES users(id), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:119: conversation_id UUID NOT NULL REFERENCES messenger_conversations(conversation_id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:120: sender_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:129: reply_to_id UUID REFERENCES messenger_messages(message_id), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:143: message_id UUID NOT NULL REFERENCES messenger_messages(message_id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:144: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:153: user_id INTEGER REFERENCES users(id) ON DELETE SET NULL, -- NULL for relay nodes /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:10: client_id INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:29: project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:33: assignee_id INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:52: project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:57: created_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:70: task_id INTEGER NOT NULL REFERENCES tasks(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:71: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:17: ADD COLUMN IF NOT EXISTS requested_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:18: ADD COLUMN IF NOT EXISTS approved_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:41: ADD COLUMN IF NOT EXISTS created_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:42: ADD COLUMN IF NOT EXISTS approved_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:72: user_id INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:94: project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:95: user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, == Indexes Created == /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:16:CREATE INDEX IF NOT EXISTS idx_refresh_tokens_user_id ON refresh_tokens(user_id); /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:19:CREATE INDEX IF NOT EXISTS idx_refresh_tokens_expires_at ON refresh_tokens(expires_at); /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:22:CREATE INDEX IF NOT EXISTS idx_refresh_tokens_revoked_at ON refresh_tokens(revoked_at) WHERE revoked_at IS NULL; /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:23:CREATE INDEX IF NOT EXISTS idx_users_initial_superuser ON users(is_initial_superuser) WHERE is_initial_superuser = true; /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:38:CREATE INDEX IF NOT EXISTS idx_superuser_transfers_from ON superuser_transfers(from_user_id); /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:39:CREATE INDEX IF NOT EXISTS idx_superuser_transfers_to ON superuser_transfers(to_user_id); /home/administrator/projects/coppertone.tech/backend/migrations/008_csrf_tokens.up.sql:14:CREATE INDEX IF NOT EXISTS idx_csrf_tokens_user_id ON csrf_tokens(user_id); /home/administrator/projects/coppertone.tech/backend/migrations/008_csrf_tokens.up.sql:15:CREATE INDEX IF NOT EXISTS idx_csrf_tokens_expires_at ON csrf_tokens(expires_at); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:441:CREATE INDEX IF NOT EXISTS idx_payment_networks_code ON payment_networks(network_code); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:442:CREATE INDEX IF NOT EXISTS idx_payment_networks_enabled ON payment_networks(is_enabled); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:444:CREATE INDEX IF NOT EXISTS idx_payment_tokens_network ON payment_tokens(network_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:445:CREATE INDEX IF NOT EXISTS idx_payment_tokens_symbol ON payment_tokens(token_symbol); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:446:CREATE INDEX IF NOT EXISTS idx_payment_tokens_verified ON payment_tokens(is_verified); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:447:CREATE INDEX IF NOT EXISTS idx_payment_tokens_enabled ON payment_tokens(is_enabled); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:448:CREATE INDEX IF NOT EXISTS idx_payment_tokens_contract ON payment_tokens(contract_address); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:450:CREATE INDEX IF NOT EXISTS idx_payment_wallets_network ON payment_wallets(network_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:451:CREATE INDEX IF NOT EXISTS idx_payment_wallets_active ON payment_wallets(is_active); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:452:CREATE INDEX IF NOT EXISTS idx_payment_wallets_primary ON payment_wallets(network_id, is_primary) WHERE is_primary = TRUE; /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:454:CREATE INDEX IF NOT EXISTS idx_payment_gateways_code ON payment_gateways(gateway_code); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:455:CREATE INDEX IF NOT EXISTS idx_payment_gateways_enabled ON payment_gateways(is_enabled); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:457:CREATE INDEX IF NOT EXISTS idx_payment_crypto_payment ON payment_crypto_details(payment_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:458:CREATE INDEX IF NOT EXISTS idx_payment_crypto_tx ON payment_crypto_details(tx_hash); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:459:CREATE INDEX IF NOT EXISTS idx_payment_crypto_network ON payment_crypto_details(network_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:460:CREATE INDEX IF NOT EXISTS idx_payment_crypto_confirmed ON payment_crypto_details(is_confirmed); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:462:CREATE INDEX IF NOT EXISTS idx_payment_audit_payment ON payment_audit_log(payment_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:463:CREATE INDEX IF NOT EXISTS idx_payment_audit_invoice ON payment_audit_log(invoice_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:464:CREATE INDEX IF NOT EXISTS idx_payment_audit_action ON payment_audit_log(action); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:465:CREATE INDEX IF NOT EXISTS idx_payment_audit_created ON payment_audit_log(created_at DESC); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:467:CREATE INDEX IF NOT EXISTS idx_donations_campaign ON donations(campaign_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:468:CREATE INDEX IF NOT EXISTS idx_donations_donor ON donations(donor_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:469:CREATE INDEX IF NOT EXISTS idx_donations_status ON donations(payment_status); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:470:CREATE INDEX IF NOT EXISTS idx_donations_created ON donations(created_at DESC); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:471:CREATE INDEX IF NOT EXISTS idx_donations_recurring ON donations(is_recurring) WHERE is_recurring = TRUE; /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:473:CREATE INDEX IF NOT EXISTS idx_campaigns_slug ON donation_campaigns(slug); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:474:CREATE INDEX IF NOT EXISTS idx_campaigns_active ON donation_campaigns(is_active); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:475:CREATE INDEX IF NOT EXISTS idx_campaigns_public ON donation_campaigns(is_public); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:477:CREATE INDEX IF NOT EXISTS idx_exchange_rates_pair ON exchange_rates(base_currency, quote_currency); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:478:CREATE INDEX IF NOT EXISTS idx_exchange_rates_history_pair ON exchange_rates_history(base_currency, quote_currency, recorded_at); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:480:CREATE INDEX IF NOT EXISTS idx_subscriptions_user ON subscriptions(user_id); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:481:CREATE INDEX IF NOT EXISTS idx_subscriptions_status ON subscriptions(status); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:24:CREATE INDEX idx_invoices_invoice_number ON invoices(invoice_number); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:25:CREATE INDEX idx_invoices_project_id ON invoices(project_id); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:26:CREATE INDEX idx_invoices_client_id ON invoices(client_id); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:27:CREATE INDEX idx_invoices_status ON invoices(status); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:28:CREATE INDEX idx_invoices_due_date ON invoices(due_date) WHERE due_date IS NOT NULL; /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:29:CREATE INDEX idx_invoices_blockchain_tx ON invoices(blockchain_tx_hash) WHERE blockchain_tx_hash IS NOT NULL; /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:57:CREATE INDEX idx_payments_invoice_id ON payments(invoice_id); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:58:CREATE INDEX idx_payments_transaction_id ON payments(transaction_id) WHERE transaction_id IS NOT NULL; /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:59:CREATE INDEX idx_payments_blockchain_tx ON payments(blockchain_tx_hash) WHERE blockchain_tx_hash IS NOT NULL; /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:60:CREATE INDEX idx_payments_status ON payments(status); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:61:CREATE INDEX idx_payments_payment_method ON payments(payment_method); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:77:CREATE INDEX idx_invoice_items_invoice_id ON invoice_items(invoice_id); /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:11:CREATE INDEX idx_users_email ON users(email) WHERE email IS NOT NULL; /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:31:CREATE INDEX idx_identities_user_id ON identities(user_id); /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:32:CREATE INDEX idx_identities_type_identifier ON identities(type, identifier); /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:33:CREATE INDEX idx_identities_primary_login ON identities(user_id, is_primary_login) WHERE is_primary_login = true; /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:48:CREATE INDEX idx_user_roles_user_id ON user_roles(user_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:186:CREATE INDEX IF NOT EXISTS idx_messenger_profiles_messaging_id ON messenger_profiles(messaging_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:187:CREATE INDEX IF NOT EXISTS idx_messenger_profiles_peer_id ON messenger_profiles(peer_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:188:CREATE INDEX IF NOT EXISTS idx_messenger_profiles_status ON messenger_profiles(status); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:190:CREATE INDEX IF NOT EXISTS idx_messenger_keys_user_active ON messenger_keys(user_id, is_active); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:191:CREATE INDEX IF NOT EXISTS idx_messenger_keys_type ON messenger_keys(key_type); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:193:CREATE INDEX IF NOT EXISTS idx_messenger_contacts_owner ON messenger_contacts(owner_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:194:CREATE INDEX IF NOT EXISTS idx_messenger_contacts_status ON messenger_contacts(status); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:195:CREATE INDEX IF NOT EXISTS idx_messenger_contacts_messaging_id ON messenger_contacts(contact_messaging_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:197:CREATE INDEX IF NOT EXISTS idx_messenger_blocklist_owner ON messenger_blocklist(owner_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:198:CREATE INDEX IF NOT EXISTS idx_messenger_blocklist_blocked ON messenger_blocklist(blocked_user_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:199:CREATE INDEX IF NOT EXISTS idx_messenger_blocklist_peer ON messenger_blocklist(blocked_peer_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:201:CREATE INDEX IF NOT EXISTS idx_messenger_conversations_type ON messenger_conversations(type); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:202:CREATE INDEX IF NOT EXISTS idx_messenger_conversations_owner ON messenger_conversations(owner_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:204:CREATE INDEX IF NOT EXISTS idx_messenger_members_conversation ON messenger_conversation_members(conversation_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:205:CREATE INDEX IF NOT EXISTS idx_messenger_members_user ON messenger_conversation_members(user_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:207:CREATE INDEX IF NOT EXISTS idx_messenger_messages_conversation ON messenger_messages(conversation_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:208:CREATE INDEX IF NOT EXISTS idx_messenger_messages_sender ON messenger_messages(sender_id); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:209:CREATE INDEX IF NOT EXISTS idx_messenger_messages_created ON messenger_messages(created_at DESC); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:210:CREATE INDEX IF NOT EXISTS idx_messenger_messages_ipfs ON messenger_messages(ipfs_cid); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:212:CREATE INDEX IF NOT EXISTS idx_messenger_peer_registry_type ON messenger_peer_registry(peer_type); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:213:CREATE INDEX IF NOT EXISTS idx_messenger_peer_registry_trusted ON messenger_peer_registry(is_trusted); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:215:CREATE INDEX IF NOT EXISTS idx_messenger_relay_active ON messenger_relay_nodes(is_active, priority DESC); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:19:CREATE INDEX idx_projects_client_id ON projects(client_id); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:20:CREATE INDEX idx_projects_status ON projects(status); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:21:CREATE INDEX idx_projects_ipfs_cid ON projects(ipfs_metadata_cid) WHERE ipfs_metadata_cid IS NOT NULL; /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:44:CREATE INDEX idx_tasks_project_id ON tasks(project_id); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:45:CREATE INDEX idx_tasks_assignee_id ON tasks(assignee_id); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:46:CREATE INDEX idx_tasks_status ON tasks(status); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:47:CREATE INDEX idx_tasks_due_date ON tasks(due_date) WHERE due_date IS NOT NULL; /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:63:CREATE INDEX idx_work_orders_project_id ON work_orders(project_id); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:64:CREATE INDEX idx_work_orders_order_number ON work_orders(order_number); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:65:CREATE INDEX idx_work_orders_created_by ON work_orders(created_by); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:78:CREATE INDEX idx_task_comments_task_id ON task_comments(task_id); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:79:CREATE INDEX idx_task_comments_user_id ON task_comments(user_id); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:28:CREATE INDEX IF NOT EXISTS idx_projects_requested_by ON projects(requested_by); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:29:CREATE INDEX IF NOT EXISTS idx_projects_approved_by ON projects(approved_by); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:30:CREATE INDEX IF NOT EXISTS idx_projects_approval_status ON projects(approval_status); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:48:CREATE INDEX IF NOT EXISTS idx_invoices_created_by ON invoices(created_by); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:49:CREATE INDEX IF NOT EXISTS idx_invoices_approved_by ON invoices(approved_by); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:50:CREATE INDEX IF NOT EXISTS idx_invoices_approval_status ON invoices(approval_status); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:83:CREATE INDEX idx_audit_log_entity ON audit_log(entity_type, entity_id); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:84:CREATE INDEX idx_audit_log_user ON audit_log(user_id); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:85:CREATE INDEX idx_audit_log_action ON audit_log(action); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:86:CREATE INDEX idx_audit_log_created_at ON audit_log(created_at); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:101:CREATE INDEX idx_project_approval_comments_project ON project_approval_comments(project_id); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:102:CREATE INDEX idx_project_approval_comments_user ON project_approval_comments(user_id); == Missing NOT NULL constraints (nullable columns) == /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:9: client_ip VARCHAR(45), -- IPv6 max length /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:10: user_agent TEXT, -- Optional: track device info /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:11: revoked_at TIMESTAMP WITH TIME ZONE, -- NULL if not revoked /home/administrator/projects/coppertone.tech/backend/migrations/007_refresh_tokens.up.sql:12: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:17:ALTER TABLE users ADD COLUMN IF NOT EXISTS is_initial_superuser BOOLEAN DEFAULT false; /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:20:ALTER TABLE users ADD COLUMN IF NOT EXISTS is_protected BOOLEAN DEFAULT false; /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:31: transferred_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:32: reason TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:87: is_initial BOOLEAN; /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:108: current_su_id INTEGER, /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:109: new_su_id INTEGER, /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:110: transfer_reason TEXT DEFAULT NULL /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:112:RETURNS BOOLEAN AS $$ /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:114: is_current_initial BOOLEAN; /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:115: new_user_exists BOOLEAN; /home/administrator/projects/coppertone.tech/backend/migrations/008_csrf_tokens.up.sql:9: client_ip VARCHAR(45), /home/administrator/projects/coppertone.tech/backend/migrations/008_csrf_tokens.up.sql:10: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:13: chain_id INTEGER, -- EVM chain ID (NULL for non-EVM) /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:15: native_decimals INTEGER DEFAULT 18, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:16: rpc_endpoint VARCHAR(500), -- Primary RPC URL /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:17: rpc_endpoints_backup TEXT[], -- Backup RPC URLs /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:18: explorer_url VARCHAR(255), -- Block explorer base URL /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:19: explorer_tx_path VARCHAR(100), -- Path for tx lookup (e.g., '/tx/') /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:20: explorer_address_path VARCHAR(100), -- Path for address lookup /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:21: is_testnet BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:22: is_enabled BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:23: min_confirmations INTEGER DEFAULT 1, -- Required confirmations /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:24: avg_block_time INTEGER, -- Seconds /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:26: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:27: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:38: logo_url VARCHAR(500), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:39: logo_ipfs_cid VARCHAR(100), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:42: is_verified BOOLEAN DEFAULT FALSE, -- Admin verified /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:43: verified_by INTEGER REFERENCES users(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:44: verified_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:45: verification_source VARCHAR(100), -- 'coingecko', 'manual', 'etherscan', etc. /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:48: coingecko_id VARCHAR(100), -- For price feeds /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:50: price_updated_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:53: is_enabled BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:54: is_stablecoin BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:59: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:60: website_url VARCHAR(255), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:63: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:64: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:74: address_type VARCHAR(20) DEFAULT 'hot', -- 'hot', 'cold', 'multisig' /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:77: derivation_path VARCHAR(100), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:78: address_index INTEGER, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:82: balance_updated_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:85: is_active BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:86: is_primary BOOLEAN DEFAULT FALSE, -- Primary wallet for this network /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:93: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:94: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:114: supports_refunds BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:115: supports_partial BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:116: supports_recurring BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:117: supports_subscriptions BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:128: is_enabled BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:129: is_test_mode BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:132: webhook_url VARCHAR(500), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:133: webhook_events TEXT[], /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:135: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:136: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:145: is_enabled BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:175: network_id INTEGER REFERENCES payment_networks(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:176: token_id INTEGER REFERENCES payment_tokens(id), -- NULL for native currency /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:179: from_address VARCHAR(100), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:188: tx_hash VARCHAR(100), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:190: block_timestamp TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:196: confirmations INTEGER DEFAULT 0, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:197: required_confirmations INTEGER DEFAULT 1, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:198: is_confirmed BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:199: confirmed_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:202: log_index INTEGER, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:205: error_message TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:206: retry_count INTEGER DEFAULT 0, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:208: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:209: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:215: payment_id INTEGER REFERENCES payments(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:216: invoice_id INTEGER REFERENCES invoices(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:219: old_status VARCHAR(50), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:220: new_status VARCHAR(50), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:223: currency VARCHAR(10), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:225: performed_by INTEGER REFERENCES users(id), -- NULL for system actions /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:226: ip_address VARCHAR(45), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:227: user_agent VARCHAR(500), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:231: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:246: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:247: short_description VARCHAR(500), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:250: cover_image_url VARCHAR(500), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:251: cover_image_ipfs_cid VARCHAR(100), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:252: video_url VARCHAR(500), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:256: goal_currency VARCHAR(10) DEFAULT 'USD', /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:258: donor_count INTEGER DEFAULT 0, -- Cached count /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:261: start_date TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:262: end_date TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:265: is_public BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:266: is_active BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:267: allow_anonymous BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:268: show_donors BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:269: show_amounts BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:275: category VARCHAR(50), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:276: tags TEXT[], /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:279: beneficiary_name VARCHAR(200), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:280: beneficiary_description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:282: created_by INTEGER REFERENCES users(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:283: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:284: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:293: campaign_id INTEGER REFERENCES donation_campaigns(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:296: donor_id INTEGER REFERENCES users(id) ON DELETE SET NULL, -- NULL for anonymous /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:297: is_anonymous BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:298: donor_name VARCHAR(200), -- Display name (optional) /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:299: donor_email VARCHAR(255), -- For receipt /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:300: donor_message TEXT, -- Public message /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:308: payment_id INTEGER REFERENCES payments(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:309: payment_method VARCHAR(50), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:310: payment_status VARCHAR(20) DEFAULT 'pending', /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:313: network_id INTEGER REFERENCES payment_networks(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:314: token_id INTEGER REFERENCES payment_tokens(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:315: tx_hash VARCHAR(100), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:322: receipt_sent BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:323: receipt_sent_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:326: is_recurring BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:327: recurring_frequency VARCHAR(20), -- 'weekly', 'monthly', 'yearly' /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:328: recurring_subscription_id VARCHAR(100), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:329: next_donation_date TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:331: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:332: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:341: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:346: perks TEXT[], /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:347: limited_quantity INTEGER, -- NULL for unlimited /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:348: claimed_count INTEGER DEFAULT 0, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:351: badge_icon VARCHAR(50), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:352: badge_color VARCHAR(7), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:353: sort_order INTEGER DEFAULT 0, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:355: is_active BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:356: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:370: fetched_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:381: recorded_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:393: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:397: currency VARCHAR(10) DEFAULT 'USD', /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:401: trial_days INTEGER DEFAULT 0, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:406: is_active BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:407: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:421: gateway_id INTEGER REFERENCES payment_gateways(id), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:422: gateway_subscription_id VARCHAR(255), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:425: started_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:426: current_period_start TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:427: current_period_end TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:428: cancelled_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:431: payment_method_id INTEGER, -- Reference to stored payment method /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:433: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:434: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/005_schema_separation.up.sql:40:CREATE OR REPLACE FUNCTION clone_tables_to_schema(target_schema TEXT) /home/administrator/projects/coppertone.tech/backend/migrations/005_schema_separation.up.sql:44: sql_stmt TEXT; /home/administrator/projects/coppertone.tech/backend/migrations/005_schema_separation.up.sql:89: sql_stmt TEXT; /home/administrator/projects/coppertone.tech/backend/migrations/005_schema_separation.up.sql:116:DROP FUNCTION IF EXISTS clone_tables_to_schema(TEXT); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:8: project_id INTEGER REFERENCES projects(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:16: blockchain_tx_hash VARCHAR(255), -- For on-chain payment proof /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:17: ipfs_document_cid VARCHAR(255), -- CID for invoice PDF on IPFS /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:18: notes TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:19: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:20: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:45: transaction_id VARCHAR(255), -- Stripe payment intent ID, BTCPay invoice ID, or blockchain tx hash /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:46: blockchain_tx_hash VARCHAR(255), -- For crypto/blockchain payments /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:47: blockchain_network VARCHAR(50), -- e.g., 'ethereum', 'bitcoin', 'polygon' /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:48: payment_processor VARCHAR(50), -- e.g., 'stripe', 'btcpay', 'direct_blockchain' /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:51: processed_at TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:52: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:53: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:72: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:73: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:108: UPDATE invoices SET status = 'PAID', paid_date = CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:5: email VARCHAR(255) UNIQUE, -- Nullable for blockchain-only users /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:6: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:7: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:22: credential TEXT, -- Password hash, public key, or other credential data /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:23: is_primary_login BOOLEAN DEFAULT false, /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:25: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:26: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:43: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:54: NEW.updated_at = CURRENT_TIMESTAMP; /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.down.sql:8:DROP FUNCTION IF EXISTS can_approve_projects(INTEGER); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.down.sql:9:DROP FUNCTION IF EXISTS user_has_role(INTEGER, user_role); /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.down.sql:11:DROP FUNCTION IF EXISTS transfer_initial_superuser(INTEGER, INTEGER, TEXT); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:9: peer_id VARCHAR(100), -- libp2p peer ID (when connected) /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:10: display_name VARCHAR(100), -- Optional display name for messaging /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:11: status VARCHAR(20) DEFAULT 'offline', -- online, offline, away, busy, invisible /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:12: status_message VARCHAR(255), -- Custom status message /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:13: last_seen_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:14: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:15: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:26: is_active BOOLEAN DEFAULT TRUE, -- Current active key /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:27: expires_at TIMESTAMP WITH TIME ZONE, -- Optional expiration for rotation /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:28: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:29: revoked_at TIMESTAMP WITH TIME ZONE, -- When key was revoked /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:39: alias VARCHAR(100), -- Custom name for this contact /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:40: status VARCHAR(20) DEFAULT 'pending', -- pending, accepted, blocked, muted /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:41: trust_level INTEGER DEFAULT 0, -- 0-100 trust score /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:42: notes TEXT, -- Private notes about contact /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:43: group_ids INTEGER[], -- Array of group IDs this contact belongs to /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:44: can_see_status BOOLEAN DEFAULT TRUE, -- Can this contact see our status /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:45: can_send_messages BOOLEAN DEFAULT TRUE, -- Can this contact message us /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:46: muted_until TIMESTAMP WITH TIME ZONE, -- Temporary mute /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:47: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:48: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:57: color VARCHAR(7), -- Hex color for UI /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:58: icon VARCHAR(50), -- Icon identifier /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:59: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:60: sort_order INTEGER DEFAULT 0, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:61: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:62: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:70: blocked_user_id INTEGER REFERENCES users(id) ON DELETE CASCADE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:71: blocked_peer_id VARCHAR(100), -- Can block by peer ID even without user /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:73: reason VARCHAR(255), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:74: block_type VARCHAR(20) DEFAULT 'full', -- full, messages_only, status_only /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:75: expires_at TIMESTAMP WITH TIME ZONE, -- Temporary block /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:76: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:86: name VARCHAR(100), -- Group name (NULL for direct) /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:87: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:88: owner_id INTEGER REFERENCES users(id) ON DELETE SET NULL, -- Creator/admin /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:89: avatar_ipfs_cid VARCHAR(100), -- Group avatar on IPFS /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:92: is_public BOOLEAN DEFAULT FALSE, -- Public groups can be discovered /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:93: max_members INTEGER DEFAULT 100, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:94: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:95: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:103: role VARCHAR(20) DEFAULT 'member', -- owner, admin, moderator, member /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:104: joined_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:105: invited_by INTEGER REFERENCES users(id), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:106: can_send BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:107: can_invite BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:108: is_muted BOOLEAN DEFAULT FALSE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:109: muted_until TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:110: last_read_at TIMESTAMP WITH TIME ZONE, -- For unread tracking /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:124: ipfs_cid VARCHAR(100), -- IPFS CID of encrypted content /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:125: content_preview VARCHAR(100), -- Optional encrypted preview for notifications /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:126: content_type VARCHAR(50) DEFAULT 'text', -- text, image, file, audio, video, reaction /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:130: edited_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:131: deleted_at TIMESTAMP WITH TIME ZONE, -- Soft delete /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:137: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:145: read_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:153: user_id INTEGER REFERENCES users(id) ON DELETE SET NULL, -- NULL for relay nodes /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:155: multiaddrs TEXT[], -- Known multiaddresses /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:156: is_trusted BOOLEAN DEFAULT FALSE, -- Manually trusted /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:157: is_banned BOOLEAN DEFAULT FALSE, -- Banned from network /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:158: ban_reason VARCHAR(255), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:159: reputation INTEGER DEFAULT 50, -- 0-100 reputation score /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:160: last_seen_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:161: first_seen_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:162: connection_count INTEGER DEFAULT 0, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:173: region VARCHAR(50), -- Geographic region /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:174: priority INTEGER DEFAULT 50, -- Higher = preferred /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:175: is_active BOOLEAN DEFAULT TRUE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:176: is_public BOOLEAN DEFAULT TRUE, -- Public bootstrap or private relay /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:177: max_connections INTEGER DEFAULT 1000, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:178: current_connections INTEGER DEFAULT 0, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:180: last_health_check TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:181: created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:182: updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:8: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:10: client_id INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:11: ipfs_metadata_cid VARCHAR(255), -- CID for project metadata stored on IPFS /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:14: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:15: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:31: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:33: assignee_id INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:35: completed_at TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:36: priority INTEGER DEFAULT 0, -- 0 = normal, higher = more urgent /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:39: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:40: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:54: description TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:56: ipfs_document_cid VARCHAR(255), -- CID for work order document on IPFS /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:57: created_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:58: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:59: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:73: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:74: updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:17: ADD COLUMN IF NOT EXISTS requested_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:18: ADD COLUMN IF NOT EXISTS approved_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:20: ADD COLUMN IF NOT EXISTS approval_date TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:21: ADD COLUMN IF NOT EXISTS rejection_reason TEXT; /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:41: ADD COLUMN IF NOT EXISTS created_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:42: ADD COLUMN IF NOT EXISTS approved_by INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:44: ADD COLUMN IF NOT EXISTS approval_date TIMESTAMP, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:45: ADD COLUMN IF NOT EXISTS rejection_reason TEXT; /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:72: user_id INTEGER REFERENCES users(id) ON DELETE SET NULL, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:73: user_email VARCHAR(255), -- Denormalized for when user is deleted /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:74: user_roles TEXT[], -- Roles at time of action /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:78: user_agent TEXT, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:79: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:97: is_internal BOOLEAN DEFAULT false, -- Internal comments only visible to STAFF/ADMIN /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:98: created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:143: NEW.approval_date := CURRENT_TIMESTAMP; /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:145: NEW.approval_date := CURRENT_TIMESTAMP; /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:165:CREATE OR REPLACE FUNCTION user_has_role(p_user_id INTEGER, p_role user_role) /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:166:RETURNS BOOLEAN AS $$ /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:176:CREATE OR REPLACE FUNCTION can_approve_projects(p_user_id INTEGER) /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:177:RETURNS BOOLEAN AS $$ == Missing DEFAULT values == /home/administrator/projects/coppertone.tech/backend/migrations/006_superuser_hierarchy.up.sql:144: INSERT INTO user_roles (user_id, role, created_at) /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.down.sql:3:DROP TRIGGER IF EXISTS update_invoice_items_updated_at ON invoice_items; /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.down.sql:4:DROP TRIGGER IF EXISTS update_payments_updated_at ON payments; /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.down.sql:5:DROP TRIGGER IF EXISTS update_invoices_updated_at ON invoices; /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:50: price_updated_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:82: balance_updated_at TIMESTAMP WITH TIME ZONE, /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:465:CREATE INDEX IF NOT EXISTS idx_payment_audit_created ON payment_audit_log(created_at DESC); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:470:CREATE INDEX IF NOT EXISTS idx_donations_created ON donations(created_at DESC); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:489: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:493: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:497: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:501: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:505: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:509: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:513: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/010_enhanced_payments.up.sql:517: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:79:-- Create triggers for updated_at /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:80:CREATE TRIGGER update_invoices_updated_at BEFORE UPDATE ON invoices /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:81: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:83:CREATE TRIGGER update_payments_updated_at BEFORE UPDATE ON payments /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:84: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:86:CREATE TRIGGER update_invoice_items_updated_at BEFORE UPDATE ON invoice_items /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:87: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:50:-- Create function to update updated_at timestamp /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:51:CREATE OR REPLACE FUNCTION update_updated_at_column() /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:54: NEW.updated_at = CURRENT_TIMESTAMP; /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:59:-- Create triggers for updated_at /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:60:CREATE TRIGGER update_users_updated_at BEFORE UPDATE ON users /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:61: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:63:CREATE TRIGGER update_identities_updated_at BEFORE UPDATE ON identities /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:64: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:209:CREATE INDEX IF NOT EXISTS idx_messenger_messages_created ON messenger_messages(created_at DESC); /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:217:-- Trigger for updated_at timestamps /home/administrator/projects/coppertone.tech/backend/migrations/009_messenger.up.sql:221: NEW.updated_at = NOW(); /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.down.sql:2:DROP TRIGGER IF EXISTS update_identities_updated_at ON identities; /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.down.sql:3:DROP TRIGGER IF EXISTS update_users_updated_at ON users; /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.down.sql:6:DROP FUNCTION IF EXISTS update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.down.sql:2:DROP TRIGGER IF EXISTS update_task_comments_updated_at ON task_comments; /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.down.sql:3:DROP TRIGGER IF EXISTS update_work_orders_updated_at ON work_orders; /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.down.sql:4:DROP TRIGGER IF EXISTS update_tasks_updated_at ON tasks; /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.down.sql:5:DROP TRIGGER IF EXISTS update_projects_updated_at ON projects; /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:81:-- Create triggers for updated_at /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:82:CREATE TRIGGER update_projects_updated_at BEFORE UPDATE ON projects /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:83: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:85:CREATE TRIGGER update_tasks_updated_at BEFORE UPDATE ON tasks /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:86: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:88:CREATE TRIGGER update_work_orders_updated_at BEFORE UPDATE ON work_orders /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:89: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:91:CREATE TRIGGER update_task_comments_updated_at BEFORE UPDATE ON task_comments /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:92: FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:86:CREATE INDEX idx_audit_log_created_at ON audit_log(created_at); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:196: p.created_at, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:207:ORDER BY p.created_at ASC; /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:217: p.created_at, /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:221:ORDER BY p.created_at DESC; == Enum Types == /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:2:CREATE TYPE invoice_status AS ENUM ('DRAFT', 'SENT', 'PAID', 'PARTIALLY_PAID', 'OVERDUE', 'VOID', 'CANCELLED'); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:32:CREATE TYPE payment_method AS ENUM ('CREDIT_CARD', 'DEBIT_CARD', 'CRYPTO_BTC', 'CRYPTO_ETH', 'CRYPTO_OTHER', 'BLOCKCHAIN_TOKEN', 'BANK_TRANSFER', 'CASH', 'OTHER'); /home/administrator/projects/coppertone.tech/backend/migrations/003_create_invoices_and_payments.up.sql:35:CREATE TYPE payment_status AS ENUM ('PENDING', 'PROCESSING', 'COMPLETED', 'FAILED', 'REFUNDED', 'CANCELLED'); /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:14:CREATE TYPE identity_type AS ENUM ('email_password', 'blockchain_address', 'did'); /home/administrator/projects/coppertone.tech/backend/migrations/001_create_users_and_identities.up.sql:36:CREATE TYPE user_role AS ENUM ('ADMIN', 'STAFF', 'CLIENT'); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:2:CREATE TYPE project_status AS ENUM ('PLANNING', 'IN_PROGRESS', 'COMPLETED', 'ON_HOLD', 'CANCELLED'); /home/administrator/projects/coppertone.tech/backend/migrations/002_create_projects_and_tasks.up.sql:24:CREATE TYPE task_status AS ENUM ('TODO', 'IN_PROGRESS', 'BLOCKED', 'COMPLETED', 'CANCELLED'); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:9:CREATE TYPE approval_status AS ENUM ('PENDING', 'APPROVED', 'REJECTED'); /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:56:CREATE TYPE audit_action AS ENUM ( /home/administrator/projects/coppertone.tech/backend/migrations/004_approval_workflow_and_audit.up.sql:63:CREATE TYPE audit_entity AS ENUM (