SQLSTATE[42883]: Undefined function: 7 ERROR:  operator does not exist: boolean = integer
LINE 7:                 AND p.delete_flag = 0
                                          ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts. (Connection: pgsql, SQL: 
            UPDATE m_raw_materials rm 
            SET period_id = (
                SELECT p.id 
                FROM m_periods p 
                WHERE p.code = rm.periode_order 
                AND p.delete_flag = 0
                LIMIT 1
            )
            WHERE rm.periode_order IS NOT NULL
        )