-- Migration: Add User and Charity Profiles
ALTER TABLE users ADD COLUMN profile_image VARCHAR(255) DEFAULT NULL AFTER full_name;

CREATE TABLE IF NOT EXISTS charity_settings (
    id INT PRIMARY KEY DEFAULT 1,
    charity_name VARCHAR(255) NOT NULL DEFAULT 'جمعية خيرية',
    charity_logo VARCHAR(255) DEFAULT NULL,
    charity_favicon VARCHAR(255) DEFAULT NULL,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    CONSTRAINT single_row CHECK (id = 1)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Initial Charity Settings
INSERT INTO charity_settings (id, charity_name) VALUES (1, 'بريد الجمعية الخيرية')
ON DUPLICATE KEY UPDATE charity_name=charity_name;
