Skip to content

Commit

Permalink
EPMRPP-95299 save last login time as integer value of milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Nov 19, 2024
1 parent 29cd5b5 commit c6784ce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Page<User> findAllByUserTypeAndExpired(@Param("userType") UserType userType,
* @param username User
*/
@Modifying(clearAutomatically = true)
@Query(value = "UPDATE users SET metadata = jsonb_set(metadata, '{metadata,last_login}', round(extract(EPOCH from clock_timestamp()) * 1000), TRUE ) WHERE login = :username", nativeQuery = true)
@Query(value = "UPDATE users SET metadata = jsonb_set(metadata, '{metadata,last_login}', to_jsonb(round(extract(EPOCH from clock_timestamp()) * 1000)), TRUE ) WHERE login = :username", nativeQuery = true)
void updateLastLoginDate(@Param("username") String username);

@Query(value = "SELECT u.login FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId", nativeQuery = true)
Expand Down

0 comments on commit c6784ce

Please sign in to comment.