-
Notifications
You must be signed in to change notification settings - Fork 55
Remove source type and link shared by EPC and DEC #1520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove source type and link shared by EPC and DEC #1520
Conversation
There was a problem hiding this 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.
97ebace to
39ebbed
Compare
There was a problem hiding this 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'; |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
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.
| 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'; |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
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.
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.