Skip to content

Commit d91f797

Browse files
committed
Remove all support for legacy audit union table
1 parent 8963dc5 commit d91f797

File tree

5 files changed

+5
-258
lines changed

5 files changed

+5
-258
lines changed

api/src/org/labkey/api/audit/query/AbstractAuditDomainKind.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.junit.Test;
2323
import org.labkey.api.audit.AbstractAuditTypeProvider;
2424
import org.labkey.api.audit.AuditLogService;
25-
import org.labkey.api.collections.CaseInsensitiveHashSet;
2625
import org.labkey.api.collections.LabKeyCollectors;
2726
import org.labkey.api.data.Container;
2827
import org.labkey.api.data.ContainerManager;
@@ -49,7 +48,6 @@
4948
import org.labkey.api.query.QueryService;
5049
import org.labkey.api.query.ValidationException;
5150
import org.labkey.api.security.User;
52-
import org.labkey.api.settings.OptionalFeatureService;
5351
import org.labkey.api.util.PageFlowUtil;
5452
import org.labkey.api.view.ActionURL;
5553
import org.labkey.api.view.NavTree;
@@ -66,8 +64,6 @@
6664
import java.util.Set;
6765
import java.util.stream.Collectors;
6866

69-
import static org.labkey.api.audit.query.DefaultAuditTypeTable.LEGACY_UNION_AUDIT_TABLE;
70-
7167
public abstract class AbstractAuditDomainKind extends DomainKind<JSONObject>
7268
{
7369
private static final String XAR_SUBSTITUTION_SCHEMA_NAME = "SchemaName";
@@ -398,14 +394,7 @@ public PropertyStorageSpec getPropertySpec(PropertyDescriptor pd, Domain domain)
398394
@Override
399395
public Set<String> getNonProvisionedTableNames()
400396
{
401-
// omit the legacy auditlog table, this can be removed once the
402-
// table is dropped after migration
403-
Set<String> tables = new CaseInsensitiveHashSet();
404-
405-
if (OptionalFeatureService.get().isFeatureEnabled(LEGACY_UNION_AUDIT_TABLE))
406-
tables.add("auditlog");
407-
408-
return tables;
397+
return Collections.emptySet();
409398
}
410399

411400
@Nullable

api/src/org/labkey/api/audit/query/DefaultAuditTypeTable.java

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.labkey.api.security.roles.CanSeeAuditLogRole;
4343
import org.labkey.api.security.roles.Role;
4444
import org.labkey.api.security.roles.RoleManager;
45-
import org.labkey.api.settings.OptionalFeatureService;
4645

4746
import java.util.ArrayList;
4847
import java.util.List;
@@ -51,10 +50,7 @@
5150

5251
public class DefaultAuditTypeTable extends FilteredTable<UserSchema>
5352
{
54-
public static final String LEGACY_UNION_AUDIT_TABLE = "legacyUnionAuditTable";
55-
5653
protected AuditTypeProvider _provider;
57-
protected Map<FieldKey, String> _legacyNameMap;
5854
protected Map<String, String> _dbSchemaToColumnMap;
5955

6056
public DefaultAuditTypeTable(AuditTypeProvider provider, TableInfo storage, UserSchema schema, ContainerFilter cf, List<FieldKey> defaultVisibleColumns)
@@ -67,17 +63,9 @@ public DefaultAuditTypeTable(AuditTypeProvider provider, TableInfo storage, User
6763
if (_provider.getDescription() != null)
6864
setDescription(_provider.getDescription());
6965

70-
_legacyNameMap = OptionalFeatureService.get().isFeatureEnabled(LEGACY_UNION_AUDIT_TABLE) ? provider.legacyNameMap() : Map.of();
71-
7266
// Create a mapping from the real dbTable names to the legacy query table names for QueryUpdateService.
7367
_dbSchemaToColumnMap = new CaseInsensitiveHashMap<>();
7468

75-
for (FieldKey legacyName : _legacyNameMap.keySet())
76-
{
77-
String newName = _legacyNameMap.get(legacyName);
78-
_dbSchemaToColumnMap.put(newName, legacyName.getName());
79-
}
80-
8169
setTitle(provider.getEventName());
8270

8371
wrapAllColumns(true);
@@ -171,17 +159,10 @@ protected ColumnInfo resolveColumn(String name)
171159

172160
String newName = null;
173161

174-
if (_legacyNameMap.isEmpty())
175-
{
176-
// Backward compatibility with widely used legacy name
177-
if ("Date".equalsIgnoreCase(name))
178-
newName = "Created";
179-
}
180-
else
181-
{
182-
// Handle the old style 'intKey1' and 'key1' columns
183-
newName = _legacyNameMap.get(FieldKey.fromParts(name));
184-
}
162+
// Backward compatibility with widely-used legacy name
163+
if ("Date".equalsIgnoreCase(name))
164+
newName = "Created";
165+
185166
col = super.resolveColumn(newName);
186167
if (col != null)
187168
{

audit/src/org/labkey/audit/AuditModule.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
import org.jetbrains.annotations.NotNull;
2020
import org.labkey.api.audit.AuditLogService;
2121
import org.labkey.api.audit.provider.SiteSettingsAuditProvider;
22-
import org.labkey.api.audit.query.DefaultAuditTypeTable;
2322
import org.labkey.api.module.DefaultModule;
2423
import org.labkey.api.module.ModuleContext;
25-
import org.labkey.api.settings.OptionalFeatureFlag;
26-
import org.labkey.api.settings.OptionalFeatureService;
2724
import org.labkey.api.view.WebPartFactory;
2825
import org.labkey.audit.query.AuditQuerySchema;
2926

@@ -76,16 +73,7 @@ public void doStartup(ModuleContext moduleContext)
7673
{
7774
AuditQuerySchema.register(this);
7875
AuditLogService.get().registerAuditType(new SiteSettingsAuditProvider());
79-
8076
AuditController.registerAdminConsoleLinks();
81-
OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(
82-
DefaultAuditTypeTable.LEGACY_UNION_AUDIT_TABLE,
83-
"Restore legacy union audit table",
84-
"Restores a legacy query that unions all the event tables together into a single query. This option will be removed in LabKey Server v26.3.",
85-
false,
86-
false,
87-
OptionalFeatureService.FeatureType.Deprecated
88-
));
8977
}
9078

9179
@Override

audit/src/org/labkey/audit/query/AuditLogUnionTable.java

Lines changed: 0 additions & 204 deletions
This file was deleted.

audit/src/org/labkey/audit/query/AuditQuerySchema.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.labkey.api.query.QueryView;
3030
import org.labkey.api.query.UserSchema;
3131
import org.labkey.api.security.User;
32-
import org.labkey.api.settings.OptionalFeatureService;
3332
import org.labkey.api.view.ViewContext;
3433
import org.labkey.audit.AuditSchema;
3534
import org.springframework.validation.BindException;
@@ -38,13 +37,10 @@
3837
import java.util.LinkedHashSet;
3938
import java.util.Set;
4039

41-
import static org.labkey.api.audit.query.DefaultAuditTypeTable.LEGACY_UNION_AUDIT_TABLE;
42-
4340
public class AuditQuerySchema extends UserSchema
4441
{
4542
public static final String SCHEMA_NAME = "auditLog";
4643
public static final String SCHEMA_DESCR = "Contains data about audit log events.";
47-
public static final String AUDIT_TABLE_NAME = "audit";
4844

4945
static public void register(Module module)
5046
{
@@ -90,9 +86,6 @@ public TableInfo createTable(String name, ContainerFilter cf)
9086
if (provider != null)
9187
return provider.createTableInfo(this, cf);
9288

93-
if (OptionalFeatureService.get().isFeatureEnabled(LEGACY_UNION_AUDIT_TABLE) && AUDIT_TABLE_NAME.equalsIgnoreCase(name))
94-
return new AuditLogUnionTable(this, cf);
95-
9689
return null;
9790
}
9891

0 commit comments

Comments
 (0)