-- =============================================================================
-- Manual SQL: columns required for Opto form save (saveOpto / tbl_consultants)
-- Run on your MySQL/MariaDB database if saves fail with "Unknown column" errors.
-- Safe to re-run: skip any line that errors with "Duplicate column name" (1060).
-- =============================================================================

-- System examination + vaccination (used by incoptoform → ConsultantModel)
ALTER TABLE `tbl_consultants` ADD COLUMN `ExamRs` TEXT NULL;
ALTER TABLE `tbl_consultants` ADD COLUMN `ExamCvs` TEXT NULL;
ALTER TABLE `tbl_consultants` ADD COLUMN `ExamThroat` TEXT NULL;
ALTER TABLE `tbl_consultants` ADD COLUMN `ExamCns` TEXT NULL;
ALTER TABLE `tbl_consultants` ADD COLUMN `ExamPa` TEXT NULL;
ALTER TABLE `tbl_consultants` ADD COLUMN `Vaccination` TEXT NULL;
ALTER TABLE `tbl_consultants` ADD COLUMN `VaccinationAmount` VARCHAR(32) NULL;
ALTER TABLE `tbl_consultants` ADD COLUMN `ExamOther` TEXT NULL;

-- Optional: "Remark" field maps to ReferTo; long text can exceed varchar(100) on old DBs
-- Uncomment if you get truncation or strict-mode errors on save:
-- ALTER TABLE `tbl_consultants` MODIFY COLUMN `ReferTo` TEXT NULL;

-- Optional: wider counselling remark (controller saves CouncRemark)
-- ALTER TABLE `tbl_consultants` MODIFY COLUMN `CouncRemark` TEXT NULL;

-- Vaccination queue (opto save + Vaccine Queue screen); receipt link:
-- CREATE TABLE IF NOT EXISTS `tbl_opd_vaccinations` ( ... ) — prefer `php artisan migrate` (2026_03_27_140000, 2026_03_27_141000).
-- ALTER TABLE `tbl_opd_receipts` ADD COLUMN `VacId` INT UNSIGNED NULL;
