-- backend/includes/setup.sql
-- cPanel → phpMyAdmin → আপনার database সিলেক্ট করুন → SQL ট্যাব → এটা paste করে Go চাপুন

CREATE TABLE IF NOT EXISTS donors (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    blood VARCHAR(5) NOT NULL,
    union_name VARCHAR(100) NOT NULL,
    phone VARCHAR(20) NOT NULL,
    last_donation DATE DEFAULT NULL,
    available TINYINT(1) DEFAULT 1,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS requests (
    id INT AUTO_INCREMENT PRIMARY KEY,
    patient VARCHAR(100) NOT NULL,
    blood VARCHAR(5) NOT NULL,
    bags INT DEFAULT 1,
    hospital VARCHAR(200) NOT NULL,
    phone VARCHAR(20) NOT NULL,
    req_date DATE NOT NULL,
    urgent TINYINT(1) DEFAULT 1,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
