Skip to content

Conversation

@AndreGAot
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the scoresheet view generation SQL function to normalize data column types by converting them to lowercase for consistent comparison. The changes aim to fix type-related issues in the scoresheet reporting system.

  • Normalizes column types to lowercase at two points in the function
  • Adds a normalized_type variable declaration
  • Updates comments to reflect the normalization

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
get_scoresheet_data.sql Adds lowercase normalization for column type comparisons and adds normalized_type variable
20251121220344_UpdateScoresheetViewGenFunction.cs Creates migration to update the SQL function
20251121220344_UpdateScoresheetViewGenFunction.Designer.cs Auto-generated designer file for the migration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

column_list TEXT;
use_text_fallback BOOLEAN := false;
i INTEGER;
normalized_type TEXT;
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

The variable normalized_type is declared but never used in the function. The normalization is performed inline using lower(row_data->>'Type') directly assigned to column_type. Consider removing this unused variable declaration or using it to store the normalized value if that improves code clarity.

Suggested change
normalized_type TEXT;

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +32
{

Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

The Down method is empty, which means this migration cannot be rolled back. For database function updates, consider implementing a rollback strategy that restores the previous version of the function from a separate SQL file or script.

Suggested change
{
{
// Restore the previous version of the scoresheet data provider function
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "Unity.GrantManager.Scripts.get_scoresheet_data_prev.sql";
using Stream stream = assembly.GetManifestResourceStream(resourceName)
?? throw new InvalidOperationException($"Could not find embedded resource: {resourceName}");
using StreamReader reader = new StreamReader(stream);
string sql = reader.ReadToEnd();
migrationBuilder.Sql(sql);

Copilot uses AI. Check for mistakes.
@AndreGAot AndreGAot merged commit 95a19fb into dev Nov 21, 2025
11 checks passed
@AndreGAot AndreGAot deleted the feature/AB#29071-scoresheet-view-data-types branch November 21, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants