Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public string GetQuery()
},
new string[] {
"%ACTIONLOGSTABLE%",
"%USERSTABLE%"
"%ASPNETUSERSTABLE%"
},
new string[] {
_sqlConfiguration.ActionLogsTable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public string GetQuery()
},
new string[] {
"%ACTIONLOGSTABLE%",
"%USERSTABLE%"
"%ASPNETUSERSTABLE%"
},
new string[] {
_sqlConfiguration.ActionLogsTable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public string GetQuery()
},
new string[] {
"%ACTIONLOGSTABLE%",
"%USERSTABLE%"
"%ASPNETUSERSTABLE%"
},
new string[] {
_sqlConfiguration.ActionLogsTable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public string GetQuery()
_sqlConfiguration.ParameterNotation,
new string[] {
"%USERID%",
"%ACTIONLOGID"
"%ACTIONLOGID%"
},
new string[] {
"UserId",
"ActionLogId"
},
new string[] {
"%ACTIONLOGSTABLE%",
"%USERSTABLE%"
"%ASPNETUSERSTABLE%"
},
Comment on lines 30 to 33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n-- ActionLogs query classes using USER table placeholders --\n'
rg -n -C2 --glob '*.cs' '%(USERSTABLE|ASPNETUSERSTABLE)%' \
  Repositories/Resgrid.Repositories.DataRepository/Queries/ActionLogs

printf '\n-- Definitions/usages of the previous-action-logs SQL template and placeholders --\n'
rg -n -C3 'SelectPreviousActionLogsByUserQuery|%(USERSTABLE|ASPNETUSERSTABLE)%' \
  Repositories/Resgrid.Repositories.DataRepository

Repository: Resgrid/Core

Length of output: 50368


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check which query builders use %USERSTABLE% and find their SQL template names
printf '\nActionLogs query builders still using %%USERSTABLE%%:\n'
rg -n '%(USERSTABLE)%' --glob '*.cs' \
  Repositories/Resgrid.Repositories.DataRepository/Queries/ActionLogs | \
  grep -oE '[A-Za-z]+Query\.cs' | sort -u

printf '\n\nNow checking the SQL templates for these specific queries:\n'
# Check if SelectActionLogsByUserIdQuery has a corresponding SQL template
rg -A2 'SelectActionLogsByUserIdQuery' \
  Repositories/Resgrid.Repositories.DataRepository/Servers/SqlServer/SqlServerConfiguration.cs | head -5

Repository: Resgrid/Core

Length of output: 418


Update the three remaining ActionLogs query builders to use %ASPNETUSERSTABLE% instead of %USERSTABLE%.

The placeholder rename is incomplete. While SelectPerviousActionLogsByUserQuery.cs now uses %ASPNETUSERSTABLE%, three other ActionLogs query builders still reference %USERSTABLE%:

  • SelectActionLogsByUserIdQuery.cs
  • SelectLastActionLogByUserIdQuery.cs
  • SelectActionLogsByCallIdQuery.cs

The SQL templates in SqlServerConfiguration and PostgreSqlConfiguration use only %ASPNETUSERSTABLE%, so these three queries will generate SQL with unreplaced tokens. Update them in the same PR to complete the migration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Repositories/Resgrid.Repositories.DataRepository/Queries/ActionLogs/SelectPerviousActionLogsByUserQuery.cs`
around lines 30 - 33, Three ActionLogs query builders still reference the old
placeholder "%USERSTABLE%"; update their token arrays to use
"%ASPNETUSERSTABLE%" so the SQL templates in
SqlServerConfiguration/PostgreSqlConfiguration will be correctly replaced.
Locate the files SelectActionLogsByUserIdQuery.cs,
SelectLastActionLogByUserIdQuery.cs, and SelectActionLogsByCallIdQuery.cs and
modify the token list (the new string[] { ... } or similar token replacement
array inside each query builder) to replace "%USERSTABLE%" with
"%ASPNETUSERSTABLE%"; verify the other token names (e.g., "%ACTIONLOGSTABLE%")
remain unchanged. Ensure the change is applied in the same pattern as
SelectPerviousActionLogsByUserQuery.cs so generated SQL contains no unreplaced
tokens.

new string[] {
_sqlConfiguration.ActionLogsTable,
Expand Down
Loading