Skip to content

Commit

Permalink
Domain sync
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdan committed Jul 30, 2024
1 parent 55da74a commit 3e5948c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/main/java/io/fusionauth/domain/GroupMember.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2022, FusionAuth, All Rights Reserved
* Copyright (c) 2018-2024, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,6 +38,10 @@ public class GroupMember implements Buildable<GroupMember> {

public ZonedDateTime insertInstant;

/**
* Deprecated since 1.52.0 (Aug 2024). Planned removal by end of 2024
*/
@Deprecated
public User user;

public UUID userId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
/*
* Copyright (c) 2022, FusionAuth, All Rights Reserved
* Copyright (c) 2022-2024, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
package io.fusionauth.domain.search;

Expand Down Expand Up @@ -41,11 +53,14 @@ public Set<String> supportedOrderByColumns() {

@Override
protected String defaultOrderBy() {
return "insertInstant ASC";
// All memberships for a given group share an insertInstant because they are recreated each time
// Add userId to provide consistent ordering within a group. The groupId ordering ensures consistency
// for a single user's memberships across multiple groups if they happen to have the same insertInstant.
return "insertInstant ASC, userId ASC, groupId ASC";
}

static {
SortableFields.put("id", "id");
SortableFields.put("id", "gm.id");
SortableFields.put("insertInstant", "gm.insert_instant");
SortableFields.put("groupId", "gm.groups_id");
SortableFields.put("tenantId", "g.tenants_id");
Expand Down

0 comments on commit 3e5948c

Please sign in to comment.