-
Notifications
You must be signed in to change notification settings - Fork 237
fix: change default_csr_format column to be nullable and required in api #3133
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
398 changes: 199 additions & 199 deletions
398
doc/DataModels/dm-cs_x-road_central_server_configuration_data_model.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...-service/infra-jpa/src/main/resources/liquibase/centerui/202511271200-ca-csr-nullable.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd" | ||
| logicalFilePath="centerui/202511271200-ca-csr-nullable.xml"> | ||
|
|
||
| <changeSet author="marc.david" id="202511271200-ca-csr-nullable"> | ||
| <comment>Make default_csr_format nullable and remove default value.</comment> | ||
|
|
||
| <dropDefaultValue | ||
| tableName="approved_cas" | ||
| columnName="default_csr_format" | ||
| columnDataType="VARCHAR(255)"/> | ||
|
|
||
| <dropNotNullConstraint | ||
| tableName="approved_cas" | ||
| columnName="default_csr_format" | ||
| columnDataType="VARCHAR(255)"/> | ||
|
|
||
| <update tableName="approved_cas"> | ||
| <column name="default_csr_format" valueComputed="NULL"/> | ||
| </update> | ||
| </changeSet> | ||
|
|
||
| </databaseChangeLog> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3547,6 +3547,9 @@ components: | |
| - $ref: '#/components/schemas/CertificationServiceSettings' | ||
| description: certification service file and settings | ||
| type: object | ||
| required: | ||
| - certificate | ||
| - default_csr_format | ||
|
Comment on lines
+3550
to
+3552
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets make sure to add this to the implementation notes field of the ticket so that we remember to mention this in the release notes as it is a breaking change to the Central Server API. |
||
| CertificationServiceSettings: | ||
| description: certification service settings | ||
| properties: | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since this is a change to an unreleased version, I wonder if it would make more sense to just modify the original changelog file. This change will otherwise look strange in the actual production version, since we will have a changelog file that adds the column as not nullable and then in the same version upgrade do this change to make it nullable.
It will potentially create some issues in the future (e.g. upgrading the open beta environment we use for the security audit) and potentially for local development environments, but I feel would make the resulting software package clearer.
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.
I thought about potentially doing it that way as well, however, liquibase themselves recommend not changing any already commited changelogs and instead do a "roll-forward", which means adding a new changelog to achieve the same result - https://www.liquibase.com/blog/dealing-with-changing-changesets
Since liquibase's update will fail if the database already has a changed changelog applied to it, this seems like the safest way to revert this non-nullable requirement.