CREATE TABLE IF NOT EXISTS `EmployeeSalaryAdjustments` (
  `ID` INT NOT NULL AUTO_INCREMENT,
  `EmpID` INT NOT NULL,
  `OldSalary` BIGINT NOT NULL,
  `NewSalary` BIGINT NOT NULL,
  `AdjustmentDate` DATE NOT NULL,
  `AdjustmentNote` TEXT NULL,
  `EnteredByUserId` INT NULL,
  `EnteredByName` VARCHAR(255) NULL,
  `EntryDate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `idx_salary_adj_emp` (`EmpID`),
  KEY `idx_salary_adj_date` (`AdjustmentDate`),
  CONSTRAINT `fk_salary_adj_emp`
    FOREIGN KEY (`EmpID`) REFERENCES `Emp` (`ID`)
    ON UPDATE CASCADE
    ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
