-- Migration to add institution_settings table
USE bolsa_trabajo;

-- Create institution_settings table
CREATE TABLE institution_settings (
    id INT AUTO_INCREMENT PRIMARY KEY,
    institution_name VARCHAR(255) NOT NULL DEFAULT 'Bolsa de Trabajo',
    institution_logo VARCHAR(255),
    institution_description TEXT,
    institution_address TEXT,
    institution_phone VARCHAR(50),
    institution_email VARCHAR(100),
    institution_website VARCHAR(255),
    contact_person VARCHAR(100),
    contact_email VARCHAR(100),
    contact_phone VARCHAR(50),
    -- Theme colors
    primary_color VARCHAR(7) DEFAULT '#27538C',
    secondary_color VARCHAR(7) DEFAULT '#204473',
    accent_color VARCHAR(7) DEFAULT '#9BABBF',
    success_color VARCHAR(7) DEFAULT '#28A745',
    warning_color VARCHAR(7) DEFAULT '#FFC107',
    danger_color VARCHAR(7) DEFAULT '#DC3545',
    info_color VARCHAR(7) DEFAULT '#17A2B8',
    light_bg_color VARCHAR(7) DEFAULT '#F2F2F2',
    dark_text_color VARCHAR(7) DEFAULT '#212426',
    -- Favicon
    favicon VARCHAR(255),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Insert default settings
INSERT INTO institution_settings (
    institution_name,
    institution_description,
    institution_address,
    institution_phone,
    institution_email
) VALUES (
    'Bolsa de Trabajo',
    'Sistema de bolsa de trabajo para conectar estudiantes y egresados con oportunidades laborales',
    'Dirección de la institución',
    '+51 123 456 789',
    'info@bolsatrabajo.edu.pe'
);