DELIMITER $$

CREATE TRIGGER after_companies_insert
AFTER INSERT
ON companies FOR EACH ROW
BEGIN
        INSERT INTO payroll_plans(company)
        VALUES(new.id);

        INSERT INTO email_settings(company_id)
        VALUES(new.id);
END$$

DELIMITER ;

DELIMITER $$

CREATE TRIGGER after_users_insert
AFTER INSERT
ON users FOR EACH ROW
BEGIN
        BEGIN
        INSERT INTO user_leave(emp_id) VALUES(new.id);
END
END$$

DELIMITER ;