Skip to content

Conversation

@matkoniecz
Copy link
Contributor

dedicated fields are introduced for them, see migrations/056.split_energy_source_part_1.up.sql

note that this migration added here has protection against data loss.

@matkoniecz matkoniecz requested a review from Copilot September 17, 2025 12:46
Copy link

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 removes the shared source type and link fields (sust_energy_rating_source_type and sust_energy_rating_source_link) that were previously used by both EPC and DEC energy rating systems, as these have been replaced with dedicated fields for each system.

  • Adds migration script with data protection to safely drop the shared source columns
  • Removes references to the shared source fields from frontend configuration and UI components
  • Removes API configuration for the deprecated fields

Reviewed Changes

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

Show a summary per file
File Description
migrations/057.split_energy_source_part_2.up.sql Migration to safely drop shared source columns with data loss protection
migrations/057.split_energy_source_part_2.down.sql Rollback migration to restore the dropped columns
app/src/frontend/config/data-fields-config.ts Removes configuration for deprecated shared source fields
app/src/frontend/building/data-containers/energy-performance.tsx Removes UI components for shared source type and link inputs
app/src/api/config/dataFields.ts Removes API configuration for deprecated source fields

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

dedicated fields are introduced for them, see migrations/056.split_energy_source_part_1.up.sql
note that this migration added here has protection against data loss.
@matkoniecz matkoniecz force-pushed the feature/energy_interface branch from 97ebace to 39ebbed Compare September 22, 2025 13:17
@matkoniecz matkoniecz requested a review from Copilot September 22, 2025 13:18
Copy link

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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

SELECT 1 FROM buildings
WHERE sust_energy_rating_source_type IS NOT NULL
) THEN
RAISE EXCEPTION 'Stopping execution: Column "sust_energy_rating_source_type" exists and contains data - migrate it to the new columns before deleting the column';
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The error messages are inconsistent in their formatting. The first message uses a hyphen before 'migrate', while the second uses 'migrate' directly. Consider standardizing the format for consistency.

Copilot uses AI. Check for mistakes.
SELECT 1 FROM buildings
WHERE sust_energy_rating_source_link IS NOT NULL
) THEN
RAISE EXCEPTION 'Stopping execution: Column "sust_energy_rating_source_link" exists and contains data - migrate it to the new columns before deleting the column';
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The error messages are inconsistent in their formatting. The first message uses a hyphen before 'migrate', while the second uses 'migrate' directly. Consider standardizing the format for consistency.

Copilot uses AI. Check for mistakes.
@matkoniecz matkoniecz merged commit 22a2c9f into colouring-cities:master Sep 22, 2025
2 checks passed
@matkoniecz matkoniecz deleted the feature/energy_interface branch September 30, 2025 18:36
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.

1 participant