· 8 years ago · Mar 09, 2018, 06:24 AM
1CREATE TABLE IF NOT EXISTS `hris_db`.`employee_salary` (
2 `id` INT NOT NULL AUTO_INCREMENT,
3 `salaryRate` DECIMAL NULL DEFAULT NULL,
4 `dateStart` DATE NULL DEFAULT NULL,
5 `dateEnd` DATE NULL DEFAULT NULL,
6 `salaryType` VARCHAR(45) NULL DEFAULT NULL,
7 `createdBy` INT NULL DEFAULT NULL,
8 `employees_id` INT NOT NULL,
9 `divisions_id` INT NOT NULL,
10 `departments_id` INT NOT NULL,
11 `branch_id` INT NOT NULL,
12 PRIMARY KEY (`id`, `employees_id`, `divisions_id`, `departments_id`, `branch_id`),
13 INDEX `fk_employee_salary_employees1_idx` (`employees_id` ASC, `divisions_id` ASC, `departments_id` ASC, `branch_id` ASC),
14 CONSTRAINT `fk_employee_salary_employees1`
15 FOREIGN KEY (`employees_id` , `divisions_id` , `departments_id` , `branch_id`)
16 REFERENCES `hris_db`.`employees` (`id` , `divisions_id` , `departments_id` , `branch_id`)
17 ON DELETE NO ACTION
18 ON UPDATE NO ACTION)
19ENGINE = InnoDB;