-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/464 add soft delete feature #511
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
Conversation
Signed-off-by: David Monichi <[email protected]>
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 introduces a soft-delete mechanism for SCL files by adding an is_deleted flag, updating repository implementations to respect it, and making the feature togglable via configuration.
- Add
is_deletedcolumn to thescl_filetable with a Flyway migration. - Introduce
SoftDeleteCompasSclDataPostgreSQLRepositoryand a producer to switch implementations based on a feature flag. - Update all queries to exclude soft-deleted records and document the new column.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| repository/pom.xml | Added quarkus-arc dependency to support CDI in Quarkus configuration. |
| repository-postgresql/src/main/resources/.../V1_5__add_soft_delete_flag.sql | Migration to add the is_deleted boolean column with default false. |
| repository-postgresql/src/main/java/.../SoftDeleteCompasSclDataPostgreSQLRepository.java | New repository variant overriding delete to set the soft-delete flag instead of hard delete. |
| repository-postgresql/src/main/java/.../CompasSclDataPostgreSQLRepositoryConfiguration.java | CDI producer that selects between the default and soft-delete repository based on a config property. |
| repository-postgresql/src/main/java/.../CompasSclDataPostgreSQLRepository.java | Added AND scl_file.is_deleted = false to existing queries to filter out soft-deleted records. |
| doc/postgresql.md | Documented the new is_deleted column in the table schema. |
| doc/development.md | New guide for running the application locally with Keycloak and PostgreSQL. |
| app/src/test/resources/docker-compose.yml | Docker Compose setup for Keycloak and PostgreSQL to support local development/testing. |
| app/src/main/resources/application.properties | Declared the soft-delete-enabled feature flag property. |
| app/src/main/resources/application-local.properties | Enabled soft delete and Flyway migrations for local development profile. |
| app/src/main/resources/application-dev-postgresql.properties | Changed default DB credentials for the dev PostgreSQL profile to compas/compas. |
| README.md | Added link to the new development documentation. |
Comments suppressed due to low confidence (2)
doc/postgresql.md:40
- The 'Null' column is marked as 'False', but the migration does not enforce NOT NULL. Either update this to 'True' or add
NOT NULLin the migration.
| is_deleted | boolean | False | Flag indicating whether the record is marked as deleted |
repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgresql/SoftDeleteCompasSclDataPostgreSQLRepository.java:27
- [nitpick] Consider adding unit or integration tests to verify that the
deletemethod correctly setsis_deletedand that filtered queries exclude soft-deleted records.
public void delete(SclFileType type, UUID id) {
...g/lfenergy/compas/scl/data/repository/postgresql/db/migration/V1_5__add_soft_delete_flag.sql
Outdated
Show resolved
Hide resolved
Signed-off-by: David Monichi <[email protected]>
3f78132 to
fc68569
Compare
…sion) Signed-off-by: David Monichi <[email protected]>
Signed-off-by: David Monichi <[email protected]>
Signed-off-by: David Monichi <[email protected]>
Signed-off-by: David Monichi <[email protected]>
Signed-off-by: David Monichi <[email protected]>
Signed-off-by: David Monichi <[email protected]>
Signed-off-by: David Monichi <[email protected]>
Signed-off-by: David Monichi <[email protected]>
Signed-off-by: David Monichi <[email protected]>
...va/org/lfenergy/compas/scl/data/repository/postgresql/CompasSclDataPostgreSQLRepository.java
Outdated
Show resolved
Hide resolved
Signed-off-by: David Monichi <[email protected]>
066fcc0 to
f8c6b88
Compare
|



No description provided.