-- Database Fix Script
-- Run this in phpMyAdmin or MySQL console if portal doesn't exist

-- Check if portal exists
SELECT * FROM portals WHERE id = 3;

-- If portal doesn't exist, insert it:
INSERT INTO portals (id, name, identifier, domain, status, settings, created_at, updated_at) 
VALUES (
    3,
    'Auriga Marketing Portal',
    'auriga',
    'brandwave.aurigaconsulting.co.in',
    'active',
    '{"brand_color":"#2ecc71","logo":"assets/images/auriga-logo.png"}',
    NOW(),
    NOW()
);

-- Verify portal exists
SELECT * FROM portals WHERE id = 3;

-- Check if users exist for this portal
SELECT * FROM users WHERE portal_id = 3 LIMIT 5;
